/* ============================================
   KRMU ECHOSENSE Design System - Components
   Shadcn/UI Inspired Reusable Classes
   ============================================ */

/* ---------- Layout: Container ---------- */
.container {
    width: 100%;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--space-4);
    padding-right: var(--space-4);
}

.container--sm {
    max-width: 640px;
}

.container--md {
    max-width: 768px;
}

.container--lg {
    max-width: 1024px;
}

/* ---------- Card ---------- */
/* Global Card Style - Liquid Glass Default */
.card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--glass-shadow-combined);

    /* Glass effect */
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.2);
    backdrop-filter: blur(var(--glass-blur)) saturate(1.2);

    overflow: hidden;
    position: relative;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* Global inheritance handles cards for all themes now */

.card__header {
    padding: var(--space-6);
    padding-bottom: 0;
}

.card__title {
    font-size: var(--text-2xl);
    font-weight: var(--font-semibold);
    line-height: var(--leading-tight);
    color: hsl(var(--card-foreground));
    letter-spacing: -0.025em;
}

.card__description {
    margin-top: var(--space-2);
    font-size: var(--text-sm);
    color: hsl(var(--muted-foreground));
}

.card__content {
    padding: var(--space-6);
}

.card__footer {
    padding: var(--space-6);
    padding-top: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
}

/* Mobile: Reduce padding on small screens */
@media (max-width: 480px) {

    .card__header,
    .card__content,
    .card__footer {
        padding-left: var(--space-4);
        padding-right: var(--space-4);
    }
}

/* ---------- Form Structure ---------- */
.form {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.field {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.label {
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    color: hsl(var(--foreground));
}

.label--required::after {
    content: " *";
    color: hsl(var(--destructive));
}

/* ---------- Input ---------- */
.input {
    width: 100%;
    height: 44px;
    padding: var(--space-2) var(--space-3);
    font-size: var(--text-sm);
    font-family: inherit;
    color: hsl(var(--foreground));
    background-color: hsl(var(--background));
    border: 1px solid hsl(var(--input));
    border-radius: var(--radius-md);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.input::placeholder {
    color: hsl(var(--muted-foreground));
}

.input:hover {
    border-color: hsl(var(--muted-foreground) / 0.5);
}

.input:focus {
    outline: none;
    border-color: hsl(var(--ring));
    box-shadow: 0 0 0 3px hsl(var(--ring) / 0.2);
}

.input:disabled {
    cursor: not-allowed;
    opacity: 0.5;
    background-color: hsl(var(--muted));
}

.input--error {
    border-color: hsl(var(--destructive));
}

.input--error:focus {
    box-shadow: 0 0 0 3px hsl(var(--destructive) / 0.2);
}

/* Input with suffix (e.g., @krmu.edu.in) */
.input-group {
    display: flex;
    align-items: center;
}

.input-group .input {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    border-right: none;
}

.input-group__suffix {
    height: 44px;
    padding: 0 var(--space-3);
    display: flex;
    align-items: center;
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    color: hsl(var(--muted-foreground));
    background-color: hsl(var(--muted));
    border: 1px solid hsl(var(--input));
    border-left: none;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    white-space: nowrap;
}

/* ---------- Helper & Error Text ---------- */
.help {
    font-size: var(--text-xs);
    color: hsl(var(--muted-foreground));
    min-height: 1.25rem;
    /* Reserve space to prevent CLS */
}

.error {
    font-size: var(--text-sm);
    color: hsl(var(--destructive));
    min-height: 1.25rem;
    /* Reserve space to prevent CLS */
    display: flex;
    align-items: center;
    gap: var(--space-1);
}

.error:empty {
    visibility: hidden;
}

.error::before {
    content: "";
    display: inline-block;
    width: 16px;
    height: 16px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ef4444' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cline x1='12' y1='8' x2='12' y2='12'/%3E%3Cline x1='12' y1='16' x2='12.01' y2='16'/%3E%3C/svg%3E");
    background-size: contain;
    flex-shrink: 0;
}

.error:empty::before {
    display: none;
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    height: 44px;
    padding: 0 var(--space-4);
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    font-family: inherit;
    line-height: 1;
    white-space: nowrap;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    cursor: pointer;
    transition: background-color var(--transition-fast),
        border-color var(--transition-fast),
        color var(--transition-fast),
        opacity var(--transition-fast);
    text-decoration: none;
}

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

/* Primary button */
.btn--primary {
    background: linear-gradient(135deg,
            hsl(142 64% 38%) 0%,
            hsl(142 64% 32%) 100%);
    color: hsl(var(--primary-foreground));
    box-shadow: 0 2px 12px rgba(34, 197, 94, 0.3);
}

.btn--primary:hover {
    box-shadow: 0 4px 20px rgba(34, 197, 94, 0.4);
    transform: translateY(-1px);
}

/* Dark theme primary button */
[data-theme="dark"] .btn--primary {
    background-color: hsl(var(--primary));
    box-shadow: none;
}

[data-theme="dark"] .btn--primary:hover {
    background-color: hsl(var(--primary) / 0.9);
    box-shadow: none;
    transform: none;
}

.btn--primary:active {
    background-color: hsl(var(--primary) / 0.8);
}

/* Secondary button */
.btn--secondary {
    background-color: hsl(var(--secondary));
    color: hsl(var(--secondary-foreground));
    border-color: hsl(var(--border));
}

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

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

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

/* Link button */
.btn--link {
    background-color: transparent;
    color: hsl(var(--primary));
    height: auto;
    padding: 0;
}

.btn--link:hover {
    text-decoration: underline;
    text-underline-offset: 4px;
}

/* Destructive button */
.btn--destructive {
    background-color: hsl(var(--destructive));
    color: hsl(var(--destructive-foreground));
}

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

/* Button sizes */
.btn--sm {
    height: 36px;
    padding: 0 var(--space-3);
    font-size: var(--text-xs);
}

.btn--lg {
    height: 52px;
    padding: 0 var(--space-6);
    font-size: var(--text-base);
}

.btn--full {
    width: 100%;
}

/* Loading state */
.btn--loading {
    position: relative;
    color: transparent !important;
}

.btn--loading::after {
    content: "";
    position: absolute;
    width: 18px;
    height: 18px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    color: hsl(var(--primary-foreground));
}

.btn--secondary.btn--loading::after,
.btn--ghost.btn--loading::after {
    color: hsl(var(--foreground));
}

/* ---------- OTP Input ---------- */
.otp-input {
    display: flex;
    gap: var(--space-2);
    justify-content: center;
}

.otp-input__digit {
    width: 48px;
    height: 56px;
    text-align: center;
    font-size: var(--text-xl);
    font-weight: var(--font-semibold);
    font-family: var(--font-mono);
    color: hsl(var(--foreground));
    background-color: hsl(var(--background));
    border: 2px solid hsl(var(--input));
    border-radius: var(--radius-md);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    caret-color: hsl(var(--primary));
}

.otp-input__digit::placeholder {
    color: hsl(var(--muted-foreground) / 0.3);
}

.otp-input__digit:hover {
    border-color: hsl(var(--muted-foreground) / 0.5);
}

.otp-input__digit:focus {
    outline: none;
    border-color: hsl(var(--ring));
    box-shadow: 0 0 0 3px hsl(var(--ring) / 0.2);
}

.otp-input__digit--filled {
    border-color: hsl(var(--primary));
    background-color: hsl(var(--primary) / 0.05);
}

/* Mobile: Smaller OTP boxes */
@media (max-width: 400px) {
    .otp-input {
        gap: var(--space-1);
    }

    .otp-input__digit {
        width: 42px;
        height: 50px;
        font-size: var(--text-lg);
    }
}

/* ---------- Badge ---------- */
.badge {
    display: inline-flex;
    align-items: center;
    padding: var(--space-1) var(--space-2);
    font-size: var(--text-xs);
    font-weight: var(--font-medium);
    border-radius: var(--radius-full);
    background-color: hsl(var(--secondary));
    color: hsl(var(--secondary-foreground));
}

.badge--primary {
    background: linear-gradient(135deg,
            hsl(142 64% 38%) 0%,
            hsl(142 64% 32%) 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.25);
}

/* Dark theme badge */
[data-theme="dark"] .badge--primary {
    background-color: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
    box-shadow: none;
}

.badge--destructive {
    background-color: hsl(var(--destructive) / 0.15);
    color: hsl(var(--destructive));
}

/* ---------- Separator ---------- */
.separator {
    height: 1px;
    width: 100%;
    background-color: hsl(var(--border));
    margin: var(--space-4) 0;
}

.separator--vertical {
    width: 1px;
    height: 100%;
    margin: 0 var(--space-4);
}

/* ---------- Toast / Alert ---------- */
.toast {
    position: fixed;
    bottom: var(--space-4);
    right: var(--space-4);
    left: var(--space-4);
    max-width: 420px;
    margin-left: auto;
    padding: var(--space-3) var(--space-4);
    background-color: hsl(var(--card));
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    z-index: var(--z-toast);
    transform: translateY(calc(100% + var(--space-4)));
    opacity: 0;
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.25s ease;
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
}

.toast--visible {
    transform: translateY(0);
    opacity: 1;
}

/* Color variants */
.toast--success {
    border-left: 4px solid hsl(142 64% 38%);
}

.toast--error {
    border-left: 4px solid hsl(var(--destructive));
}

.toast--warning {
    border-left: 4px solid hsl(38 90% 50%);
}

.toast--info {
    border-left: 4px solid hsl(210 90% 55%);
}

/* Icon circle */
.toast__icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    margin-top: 1px;
}

.toast--success .toast__icon {
    background: hsl(142 64% 38% / 0.12);
}

.toast--error .toast__icon {
    background: hsl(var(--destructive) / 0.12);
}

.toast--warning .toast__icon {
    background: hsl(38 90% 50% / 0.12);
}

.toast--info .toast__icon {
    background: hsl(210 90% 55% / 0.12);
}

/* Body */
.toast__body {
    flex: 1;
    min-width: 0;
}

.toast__title {
    font-weight: var(--font-semibold);
    font-size: var(--text-sm);
    margin-bottom: 2px;
    line-height: 1.3;
}

.toast__message {
    font-size: var(--text-xs);
    color: hsl(var(--muted-foreground));
    line-height: 1.4;
}

/* Dismiss button */
.toast__close {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    background: none;
    border: none;
    cursor: pointer;
    color: hsl(var(--muted-foreground));
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    padding: 0;
    font-size: 16px;
    line-height: 1;
    transition: background-color var(--transition-fast), color var(--transition-fast);
}

.toast__close:hover {
    background-color: hsl(var(--muted));
    color: hsl(var(--foreground));
}


/* ---------- Email Preview ---------- */
.email-preview {
    display: inline-flex;
    align-items: center;
    padding: var(--space-2) var(--space-3);
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    color: hsl(var(--primary));
    background-color: hsl(var(--primary) / 0.1);
    border-radius: var(--radius-md);
    border: 1px solid hsl(var(--primary) / 0.2);
}

/* ---------- Step Indicator (for multi-step forms) ---------- */
.steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    margin-bottom: var(--space-6);
}

.steps__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: hsl(var(--muted));
    transition: background-color var(--transition-fast), transform var(--transition-fast);
}

.steps__dot--active {
    background-color: hsl(var(--primary));
    transform: scale(1.25);
}

.steps__dot--completed {
    background-color: hsl(var(--primary));
}

/* ---------- Auth Layout ---------- */
.auth-layout {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-4);
    position: relative;
    overflow: hidden;
}

.auth-layout__bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
}

.auth-layout__video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.auth-layout__overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom,
            hsl(var(--background) / 0.85),
            hsl(var(--background) / 0.95));
    z-index: -1;
}

/* Disable video on reduced motion or slow devices */
@media (prefers-reduced-motion: reduce) {
    .auth-layout__video {
        display: none;
    }
}

.auth-layout__card {
    width: 100%;
    max-width: 420px;
    position: relative;
}

/* Header nav */
.auth-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    padding: var(--space-4);
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 10;
}

.auth-header__brand {
    font-size: var(--text-lg);
    font-weight: var(--font-bold);
    color: hsl(var(--foreground));
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.auth-header__brand-accent {
    color: hsl(var(--primary));
}

/* Step visibility */
.step {
    display: none;
}

.step--active {
    display: block;
    animation: fadeIn var(--transition-normal);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ---------- Utilities ---------- */
.text-center {
    text-align: center;
}

.text-muted {
    color: hsl(var(--muted-foreground));
}

.text-sm {
    font-size: var(--text-sm);
}

.text-xs {
    font-size: var(--text-xs);
}

.font-mono {
    font-family: var(--font-mono);
}

.mt-2 {
    margin-top: var(--space-2);
}

.mt-4 {
    margin-top: var(--space-4);
}

.mt-6 {
    margin-top: var(--space-6);
}

.mb-2 {
    margin-bottom: var(--space-2);
}

.mb-4 {
    margin-bottom: var(--space-4);
}

.gap-2 {
    gap: var(--space-2);
}

.gap-3 {
    gap: var(--space-3);
}

.gap-4 {
    gap: var(--space-4);
}

.gap-6 {
    gap: var(--space-6);
}

/* ---------- Padding Utilities ---------- */
.p-2 {
    padding: var(--space-2);
}

.p-3 {
    padding: var(--space-3);
}

.p-4 {
    padding: var(--space-4);
}

.py-4 {
    padding-top: var(--space-4);
    padding-bottom: var(--space-4);
}

/* ---------- Sizing Utilities ---------- */
.w-10 {
    width: var(--space-10);
}

.h-10 {
    height: var(--space-10);
}

.w-20 {
    width: 5rem;
}

.w-24 {
    width: 6rem;
}

.w-32 {
    width: 8rem;
}

.w-40 {
    width: 10rem;
}

.h-3 {
    height: var(--space-3);
}

/* ---------- Flex Utilities ---------- */
.flex-1 {
    flex: 1 1 0%;
}

/* ---------- Border Radius Utilities ---------- */
.rounded-md {
    border-radius: var(--radius-md);
}

.rounded-full {
    border-radius: var(--radius-full);
}

/* ---------- Background Utilities ---------- */
.bg-primary-10 {
    background-color: hsl(var(--primary) / 0.1);
}

.bg-volunteer-10 {
    background-color: hsl(var(--volunteer) / 0.1);
}

/* ---------- State Utilities ---------- */
.opacity-50 {
    opacity: 0.5;
}

.cursor-not-allowed {
    cursor: not-allowed;
}

.transition-colors {
    transition: background-color var(--transition-fast), color var(--transition-fast);
}

/* ---------- Hover States (requires JS toggle or :hover) ---------- */
.hover-bg-muted:hover {
    background-color: hsl(var(--muted) / 0.1);
}

.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.items-center {
    align-items: center;
}

.justify-center {
    justify-content: center;
}

.justify-between {
    justify-content: space-between;
}

/* ========== THEME TOGGLE ========== */
.theme-toggle {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 4px;
    background-color: hsl(var(--muted));
    border-radius: var(--radius-full);
    border: 1px solid hsl(var(--border));
}

.theme-toggle__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: var(--radius-full);
    color: hsl(var(--muted-foreground));
    cursor: pointer;
    transition:
        background-color var(--transition-fast),
        color var(--transition-fast),
        transform var(--transition-fast);
}

.theme-toggle__btn:hover {
    color: hsl(var(--foreground));
    background-color: hsl(var(--background));
}

.theme-toggle__btn--active {
    color: hsl(var(--primary));
    background-color: hsl(var(--background));
    box-shadow: var(--shadow-sm);
}

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

.theme-toggle__btn svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* ========== SKIP LINK (Accessibility) ========== */
.skip-link {
    position: fixed;
    top: -100%;
    left: var(--space-4);
    z-index: 9999;
    padding: var(--space-2) var(--space-4);
    background-color: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
    border-radius: var(--radius-md);
    font-weight: var(--font-medium);
    text-decoration: none;
    transition: top var(--transition-fast);
}

.skip-link:focus {
    top: var(--space-4);
}

/* ========== SPINNER ========== */
.spinner {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid hsl(var(--muted));
    border-top-color: hsl(var(--primary));
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.spinner--sm {
    width: 16px;
    height: 16px;
    border-width: 2px;
}

.spinner--lg {
    width: 40px;
    height: 40px;
    border-width: 4px;
}

/* Full-page spinner overlay */
.spinner-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: hsl(var(--background) / 0.8);
    backdrop-filter: blur(4px);
    z-index: var(--z-modal);
}

/* ========== ALERT ========== */
.alert {
    padding: var(--space-4);
    border-radius: var(--radius-md);
    border: 1px solid hsl(var(--border));
    background-color: hsl(var(--card));
}

.alert--success {
    border-color: hsl(var(--primary) / 0.5);
    background-color: hsl(var(--primary) / 0.1);
}

.alert--error {
    border-color: hsl(var(--destructive) / 0.5);
    background-color: hsl(var(--destructive) / 0.1);
}

.alert--warning {
    border-color: hsl(45 93% 47% / 0.5);
    background-color: hsl(45 93% 47% / 0.1);
}

.alert__title {
    font-weight: var(--font-semibold);
    margin-bottom: var(--space-1);
}

.alert__message {
    font-size: var(--text-sm);
    color: hsl(var(--muted-foreground));
}

/* ========== VIDEO BACKGROUND (Improved visibility) ========== */
.auth-layout__bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    overflow: hidden;
}

.auth-layout__video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.05);
    animation: videoZoom 30s ease-in-out infinite alternate;
}

@keyframes videoZoom {
    0% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1.15);
    }
}

/* More visible overlay - less opacity for video visibility */
.auth-layout__overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg,
            hsl(var(--background) / 0.45) 0%,
            hsl(var(--background) / 0.55) 50%,
            hsl(var(--background) / 0.5) 100%);
    z-index: -1;
}

/* Dark theme: darker overlay */
[data-theme="dark"] .auth-layout__overlay {
    background: linear-gradient(135deg,
            hsl(var(--background) / 0.55) 0%,
            hsl(var(--background) / 0.7) 50%,
            hsl(var(--background) / 0.6) 100%);
}

/* Disable video animation on reduced motion */
@media (prefers-reduced-motion: reduce) {
    .auth-layout__video {
        animation: none;
        transform: scale(1.05);
    }
}

/* ========== SUBTLE ANIMATIONS ========== */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.6;
    }
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

/* Animation utility classes */
.animate-slideUp {
    animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.animate-slideDown {
    animation: slideDown 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.animate-scaleIn {
    animation: scaleIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.animate-pulse {
    animation: pulse 2s ease-in-out infinite;
}

/* Stagger animation delays */
.animate-delay-100 {
    animation-delay: 100ms;
}

.animate-delay-200 {
    animation-delay: 200ms;
}

.animate-delay-300 {
    animation-delay: 300ms;
}

.animate-delay-400 {
    animation-delay: 400ms;
}

/* Disable animations on reduced motion */
@media (prefers-reduced-motion: reduce) {

    .animate-slideUp,
    .animate-slideDown,
    .animate-scaleIn,
    .animate-pulse {
        animation: none;
        opacity: 1;
        transform: none;
    }
}

/* ========== SKELETON LOADER ========== */
.skeleton {
    background: linear-gradient(90deg,
            hsl(var(--muted)) 0%,
            hsl(var(--muted-foreground) / 0.1) 50%,
            hsl(var(--muted)) 100%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-md);
}

.skeleton--text {
    height: 1em;
    width: 100%;
    margin-bottom: var(--space-2);
}

.skeleton--title {
    height: 1.5em;
    width: 60%;
    margin-bottom: var(--space-4);
}

.skeleton--avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

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

/* ========== TABLE ========== */
.table-container {
    width: 100%;
    overflow-x: auto;
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius-lg);
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--text-sm);
}

.table th,
.table td {
    padding: var(--space-3) var(--space-4);
    text-align: left;
    border-bottom: 1px solid hsl(var(--border));
}

.table th {
    font-weight: var(--font-medium);
    color: hsl(var(--muted-foreground));
    background-color: hsl(var(--muted));
    position: sticky;
    top: 0;
    z-index: 1;
}

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

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

/* Mobile: Convert table rows to cards */
@media (max-width: 640px) {
    .table--responsive thead {
        display: none;
    }

    .table--responsive tbody tr {
        display: block;
        margin-bottom: var(--space-4);
        padding: var(--space-4);
        background-color: hsl(var(--card));
        border: 1px solid hsl(var(--border));
        border-radius: var(--radius-md);
    }

    .table--responsive tbody td {
        display: flex;
        justify-content: space-between;
        padding: var(--space-2) 0;
        border-bottom: 1px solid hsl(var(--border) / 0.5);
    }

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

    .table--responsive tbody td::before {
        content: attr(data-label);
        font-weight: var(--font-medium);
        color: hsl(var(--muted-foreground));
    }
}

/* ========== GLOBAL HEADER ========== */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    width: 100%;
    padding: var(--space-3) var(--space-4);
    background-color: hsl(var(--background) / 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid hsl(var(--border));
}

.site-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
}

.site-header__brand {
    font-size: var(--text-lg);
    font-weight: var(--font-bold);
    color: hsl(var(--foreground));
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.site-header__brand:hover {
    text-decoration: none;
}

.site-header__brand-accent {
    color: hsl(var(--primary));
}

.site-header__nav {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

/* ========== EMPTY STATE ========== */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-12);
    text-align: center;
}

.empty-state__icon {
    width: 64px;
    height: 64px;
    margin-bottom: var(--space-4);
    color: hsl(var(--muted-foreground));
}

.empty-state__title {
    font-size: var(--text-lg);
    font-weight: var(--font-semibold);
    margin-bottom: var(--space-2);
}

.empty-state__description {
    font-size: var(--text-sm);
    color: hsl(var(--muted-foreground));
    max-width: 400px;
}

/* ========== PAGINATION ========== */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-1);
    margin-top: var(--space-4);
}

.pagination__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 var(--space-2);
    font-size: var(--text-sm);
    color: hsl(var(--foreground));
    background-color: transparent;
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background-color var(--transition-fast);
}

.pagination__btn:hover {
    background-color: hsl(var(--muted));
}

.pagination__btn--active {
    background-color: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
    border-color: hsl(var(--primary));
}

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

/* ========== DEFAULT (LIGHT) THEME STYLES ========== */

/* Table container */
.table-container {
    background: var(--glass-bg-subtle);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
}

/* Table rows */
.table tbody tr:nth-child(odd) {
    background: rgba(255, 255, 255, 0.3);
}

.table tbody tr:hover {
    background: rgba(34, 197, 94, 0.08);
}

/* Table header */
.table thead th {
    background: rgba(255, 255, 255, 0.5);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

/* Site header glass */
.site-header {
    background: var(--glass-bg-card);
    -webkit-backdrop-filter: blur(20px) saturate(1.3);
    backdrop-filter: blur(20px) saturate(1.3);
    border-bottom: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
}

/* ========== DARK THEME OVERRIDES ========== */

[data-theme="dark"] .table-container {
    background: var(--glass-bg-card);
}

[data-theme="dark"] .table tbody tr:nth-child(odd) {
    background: rgba(255, 255, 255, 0.02);
}

[data-theme="dark"] .table tbody tr:hover {
    background: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .table thead th {
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .site-header {
    background: var(--glass-bg-dark);
    border-bottom: 1px solid var(--glass-border);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}