/*
 * SHADCN-INSPIRED DESIGN SYSTEM
 * For Pasarmobkas - PHP + Tailwind CSS
 * Modern, Clean UI Components with Smooth Animations
 */

/* ========================================
   CSS VARIABLES - Shadcn Style
   ======================================== */
:root {
    /* Base Colors - Zinc-like (Shadcn default) */
    --background: 0 0% 100%;
    --foreground: 240 10% 3.9%;
    --card: 0 0% 100%;
    --card-foreground: 240 10% 3.9%;
    --popover: 0 0% 100%;
    --popover-foreground: 240 10% 3.9%;
    --primary: 180 45% 40%;      /* Brand teal #4A9782 */
    --primary-foreground: 180 45% 98%;
    --secondary: 240 4.8% 95.9%;
    --secondary-foreground: 240 5.9% 10%;
    --muted: 240 4.8% 95.9%;
    --muted-foreground: 240 3.8% 46.1%;
    --accent: 240 4.8% 95.9%;
    --accent-foreground: 240 5.9% 10%;
    --destructive: 0 84.2% 60.2%;
    --destructive-foreground: 0 0% 98%;
    --border: 240 5.9% 90%;
    --input: 240 5.9% 90%;
    --ring: 180 45% 40%;
    --radius: 0.5rem;

    /* Brand Colors */
    --brand-primary: #4A9782;
    --brand-primary-hover: #3d7f6d;
    --brand-primary-light: #5eac96;

    /* Semantic Colors */
    --success: 142 76% 36%;
    --warning: 38 92% 50%;
    --error: 0 84% 60%;
    --info: 199 89% 48%;
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    :root {
        --background: 240 10% 3.9%;
        --foreground: 0 0% 98%;
        --card: 240 10% 3.9%;
        --card-foreground: 0 0% 98%;
        --popover: 240 10% 3.9%;
        --popover-foreground: 0 0% 98%;
        --primary: 180 45% 50%;
        --primary-foreground: 180 45% 10%;
        --secondary: 240 3.7% 15.9%;
        --secondary-foreground: 0 0% 98%;
        --muted: 240 3.7% 15.9%;
        --muted-foreground: 240 5% 64.9%;
        --accent: 240 3.7% 15.9%;
        --accent-foreground: 0 0% 98%;
        --destructive: 0 62.8% 30.6%;
        --destructive-foreground: 0 0% 98%;
        --border: 240 3.7% 15.9%;
        --input: 240 3.7% 15.9%;
        --ring: 180 45% 50%;
    }
}

/* ========================================
   BASE STYLES
   ======================================== */
* {
    border-color: hsl(var(--border));
}

body {
    background-color: hsl(var(--background));
    color: hsl(var(--foreground));
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ========================================
   BUTTON COMPONENTS - Shadcn Style
   ======================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    white-space: nowrap;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.25rem;
    padding: 0.5rem 1rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    outline: none;
    border: 1px solid transparent;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.btn:focus-visible {
    outline: 2px solid hsl(var(--ring));
    outline-offset: 2px;
}

.btn:disabled {
    opacity: 0.5;
    pointer-events: none;
}

/* Button Sizes */
.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}

.btn-xl {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

/* Button Variants */
.btn-primary {
    background-color: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.btn-primary:hover {
    background-color: var(--brand-primary-hover);
    box-shadow: 0 4px 12px rgba(74, 151, 130, 0.3);
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: hsl(var(--secondary));
    color: hsl(var(--secondary-foreground));
    border: 1px solid hsl(var(--border));
}

.btn-secondary:hover {
    background-color: hsl(var(--accent));
}

.btn-outline {
    background-color: transparent;
    border: 1px solid hsl(var(--border));
    color: hsl(var(--foreground));
}

.btn-outline:hover {
    background-color: hsl(var(--accent));
    color: hsl(var(--accent-foreground));
}

.btn-ghost {
    background-color: transparent;
    color: hsl(var(--foreground));
}

.btn-ghost:hover {
    background-color: hsl(var(--accent));
    color: hsl(var(--accent-foreground));
}

.btn-destructive {
    background-color: hsl(var(--destructive));
    color: hsl(var(--destructive-foreground));
}

.btn-destructive:hover {
    background-color: hsl(var(--destructive) / 0.9);
}

/* Icon Button */
.btn-icon {
    padding: 0.5rem;
    width: 2.5rem;
    height: 2.5rem;
}

/* ========================================
   CARD COMPONENTS - Shadcn Style
   ======================================== */
.card {
    border-radius: calc(var(--radius) + 0.25rem);
    border: 1px solid hsl(var(--border));
    background-color: hsl(var(--card));
    color: hsl(var(--card-foreground));
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.card:hover {
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.card-header {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.card-title {
    font-size: 1.125rem;
    font-weight: 600;
    line-height: 1;
    letter-spacing: -0.025em;
}

.card-description {
    font-size: 0.875rem;
    color: hsl(var(--muted-foreground));
}

.card-content {
    padding: 0 1.5rem 1.5rem 1.5rem;
}

.card-footer {
    padding: 1.5rem;
    border-top: 1px solid hsl(var(--border));
    display: flex;
    align-items: center;
    padding-top: 1rem;
}

/* ========================================
   INPUT COMPONENTS - Shadcn Style
   ======================================== */
.input {
    display: flex;
    height: 2.5rem;
    width: 100%;
    border-radius: var(--radius);
    border: 1px solid hsl(var(--input));
    background-color: transparent;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    transition: all 0.2s;
    outline: none;
}

.input:focus {
    outline: 2px solid hsl(var(--ring));
    outline-offset: 2px;
    border-color: hsl(var(--ring));
}

.input:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.input-sm {
    height: 2rem;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

.input-lg {
    height: 3rem;
    padding: 0.75rem 1rem;
    font-size: 1rem;
}

/* Textarea */
.textarea {
    min-height: 80px;
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
    resize: vertical;
}

/* ========================================
   BADGE COMPONENTS - Shadcn Style
   ======================================== */
.badge {
    display: inline-flex;
    align-items: center;
    border-radius: 9999px;
    border: 1px solid transparent;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    transition: all 0.2s;
}

.badge-primary {
    background-color: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
}

.badge-secondary {
    background-color: hsl(var(--secondary));
    color: hsl(var(--secondary-foreground));
}

.badge-outline {
    border-color: hsl(var(--border));
    color: hsl(var(--foreground));
}

.badge-success {
    background-color: hsl(var(--success) / 0.15);
    color: hsl(var(--success));
    border: 1px solid hsl(var(--success) / 0.3);
}

.badge-warning {
    background-color: hsl(var(--warning) / 0.15);
    color: hsl(var(--warning));
    border: 1px solid hsl(var(--warning) / 0.3);
}

.badge-error {
    background-color: hsl(var(--error) / 0.15);
    color: hsl(var(--error));
    border: 1px solid hsl(var(--error) / 0.3);
}

/* ========================================
   SKELETON LOADING - Shadcn Style
   ======================================== */
@keyframes skeleton-shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.skeleton {
    background-color: hsl(var(--muted));
    background-image: linear-gradient(
        90deg,
        hsl(var(--muted)) 0px,
        hsl(var(--muted) / 0.5) 50%,
        hsl(var(--muted)) 1000px
    );
    background-size: 1000px 100%;
    animation: skeleton-shimmer 2s infinite linear;
    border-radius: var(--radius);
}

.skeleton-sm {
    height: 1rem;
}

.skeleton-md {
    height: 1.5rem;
}

.skeleton-lg {
    height: 2rem;
}

.skeleton-xl {
    height: 3rem;
}

.skeleton-circle {
    border-radius: 50%;
}

.skeleton-avatar {
    width: 3rem;
    height: 3rem;
}

.skeleton-card {
    height: 200px;
    width: 100%;
}

.skeleton-image {
    aspect-ratio: 16 / 9;
    width: 100%;
}

/* ========================================
   ALERT COMPONENTS - Shadcn Style
   ======================================== */
.alert {
    border-radius: var(--radius);
    border: 1px solid hsl(var(--border));
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
}

.alert-title {
    font-weight: 600;
    font-size: 0.875rem;
}

.alert-description {
    font-size: 0.875rem;
    color: hsl(var(--muted-foreground));
}

.alert-default {
    background-color: hsl(var(--background));
}

.alert-destructive {
    border-color: hsl(var(--destructive) / 0.3);
    background-color: hsl(var(--destructive) / 0.05);
    color: hsl(var(--destructive));
}

.alert-success {
    border-color: hsl(var(--success) / 0.3);
    background-color: hsl(var(--success) / 0.05);
    color: hsl(var(--success));
}

/* ========================================
   TOOLTIP COMPONENTS - Shadcn Style
   ======================================== */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip-content {
    visibility: hidden;
    background-color: hsl(var(--popover));
    color: hsl(var(--popover-foreground));
    text-align: center;
    border-radius: var(--radius);
    padding: 0.5rem 0.75rem;
    position: absolute;
    z-index: 100;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.75rem;
    white-space: nowrap;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    border: 1px solid hsl(var(--border));
    opacity: 0;
    transition: opacity 0.2s, visibility 0.2s;
}

.tooltip:hover .tooltip-content {
    visibility: visible;
    opacity: 1;
}

/* ========================================
   SEPARATOR COMPONENTS - Shadcn Style
   ======================================== */
.separator {
    height: 1px;
    width: 100%;
    background-color: hsl(var(--border));
    margin: 1rem 0;
}

.separator-vertical {
    width: 1px;
    height: 100%;
    background-color: hsl(var(--border));
    margin: 0 1rem;
}

/* ========================================
   TABLE COMPONENTS - Shadcn Style
   ======================================== */
.table-container {
    border-radius: var(--radius);
    border: 1px solid hsl(var(--border));
    overflow: hidden;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.table thead {
    background-color: hsl(var(--muted));
}

.table th {
    text-align: left;
    padding: 0.75rem 1rem;
    font-weight: 600;
    color: hsl(var(--muted-foreground));
    border-bottom: 1px solid hsl(var(--border));
}

.table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid hsl(var(--border));
}

.table tbody tr:hover {
    background-color: hsl(var(--muted) / 0.5);
}

.table tbody tr:last-child td {
    border-bottom: none;
}

/* ========================================
   PROGRESS COMPONENTS - Shadcn Style
   ======================================== */
.progress {
    position: relative;
    overflow: hidden;
    background-color: hsl(var(--secondary));
    border-radius: 9999px;
    width: 100%;
    height: 0.5rem;
}

.progress-value {
    height: 100%;
    background-color: hsl(var(--primary));
    transition: all 0.3s ease;
    border-radius: 9999px;
}

/* ========================================
   TOGGLE/SWITCH COMPONENTS - Shadcn Style
   ======================================== */
.switch {
    position: relative;
    display: inline-block;
    width: 2.75rem;
    height: 1.5rem;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.switch-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: hsl(var(--input));
    transition: 0.3s;
    border-radius: 9999px;
}

.switch-slider:before {
    position: absolute;
    content: "";
    height: 1.125rem;
    width: 1.125rem;
    left: 0.1875rem;
    bottom: 0.1875rem;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.switch input:checked + .switch-slider {
    background-color: hsl(var(--primary));
}

.switch input:checked + .switch-slider:before {
    transform: translateX(1.25rem);
}

/* ========================================
   UTILITIES
   ======================================== */
.glass-effect {
    background-color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.hover-lift {
    transition: transform 0.2s, box-shadow 0.2s;
}

.hover-lift:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
}

.fade-in {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Focus Visible Utility */
.focus-ring:focus-visible {
    outline: 2px solid hsl(var(--ring));
    outline-offset: 2px;
}

/* Truncate Text */
.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ========================================
   RESPONSIVE UTILITIES
   ======================================== */
@media (max-width: 640px) {
    .card {
        border-radius: var(--radius);
    }

    .btn {
        padding: 0.5rem 0.875rem;
    }
}

/* ========================================
   PRINT STYLES
   ======================================== */
@media print {
    .skeleton,
    .btn,
    .no-print {
        display: none !important;
    }

    .card {
        box-shadow: none;
        border: 1px solid #ccc;
    }
}

/* ========================================
   REDUCED MOTION
   ======================================== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
