/**
 * SafeRx Theme CSS
 * "Trustworthy Teal & Organic Flow" Design System
 *
 * Central theme file with CSS variables and utility classes
 * Apply to all pages: <link rel="stylesheet" href="/css/saferx-theme.css">
 */

/* ========================================
   CSS Custom Properties (Variables)
   ======================================== */
:root {
    /* Primary Colors - Teal Family */
    --theme-primary: #068466;
    --theme-primary-dark: #047857;
    --theme-primary-light: #10B981;
    --theme-primary-hover: #059669;

    /* Secondary Colors - Mint Family */
    --theme-secondary: #B2EBF2;
    --theme-secondary-dark: #80DEEA;
    --theme-secondary-light: #E6FAF4;

    /* Accent Colors - Amber (kept for semantic use) */
    --theme-accent: #F59E0B;
    --theme-accent-dark: #D97706;
    --theme-accent-light: #FEF3C7;

    /* Neutral Colors */
    --theme-bg: #F5F3EF;
    --theme-bg-alt: #EDE9E3;
    --theme-card: #FEFEFE;
    --theme-card-hover: #FFFFFF;

    /* Text Colors */
    --theme-text: #1F2937;
    --theme-text-secondary: #64748B;
    --theme-text-muted: #94A3B8;
    --theme-text-inverse: #FFFFFF;

    /* Border Colors */
    --theme-border: #E8E4DF;
    --theme-border-light: #F0EDE8;
    --theme-border-focus: #068466;

    /* Semantic Colors (kept for meaning) */
    --theme-success: #10B981;
    --theme-warning: #F59E0B;
    --theme-danger: #DC2626;
    --theme-info: #3B82F6;

    /* Typography */
    --font-display: 'Playfair Display', Georgia, 'Times New Roman', serif;
    --font-body: 'DM Sans', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-arabic: 'Cairo', 'Tajawal', 'Noto Sans Arabic', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

    /* Border Radius - Organic, rounded */
    --radius-xs: 6px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-2xl: 24px;
    --radius-full: 9999px;

    /* Shadows - Warm teal-tinted */
    --shadow-xs: 0 1px 2px rgba(6, 132, 102, 0.04);
    --shadow-sm: 0 2px 4px rgba(6, 132, 102, 0.06);
    --shadow-md: 0 4px 12px rgba(6, 132, 102, 0.1);
    --shadow-lg: 0 8px 24px rgba(6, 132, 102, 0.14);
    --shadow-xl: 0 16px 40px rgba(6, 132, 102, 0.18);
    --shadow-glow: 0 0 20px rgba(6, 132, 102, 0.25);

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-base: 0.2s ease;
    --transition-slow: 0.3s ease;
    --transition-bounce: 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);

    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;

    /* Z-Index Scale */
    --z-dropdown: 100;
    --z-modal: 1000;
    --z-tooltip: 1100;
    --z-navbar: 9999;
}

/* ========================================
   Gradients
   ======================================== */
:root {
    /* Primary gradients */
    --gradient-primary: linear-gradient(135deg, #068466 0%, #047857 100%);
    --gradient-primary-vibrant: linear-gradient(135deg, #068466 0%, #047857 50%, #10B981 100%);
    --gradient-primary-subtle: linear-gradient(135deg, #E6FAF4 0%, #B2EBF2 100%);

    /* Background gradients */
    --gradient-bg: linear-gradient(180deg, #F5F3EF 0%, #E6FAF4 100%);
    --gradient-hero: linear-gradient(135deg, #068466 0%, #047857 50%, #10B981 100%);

    /* Accent gradients */
    --gradient-accent: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
}

/* ========================================
   Typography Utilities
   ======================================== */
.font-display {
    font-family: var(--font-display);
}

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

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

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

/* ========================================
   Color Utilities
   ======================================== */
.text-primary { color: var(--theme-primary); }
.text-secondary { color: var(--theme-text-secondary); }
.text-muted { color: var(--theme-text-muted); }
.text-success { color: var(--theme-success); }
.text-warning { color: var(--theme-warning); }
.text-danger { color: var(--theme-danger); }

.bg-primary { background-color: var(--theme-primary); }
.bg-secondary { background-color: var(--theme-secondary-light); }
.bg-card { background-color: var(--theme-card); }
.bg-page { background-color: var(--theme-bg); }

/* ========================================
   Border Radius Utilities
   ======================================== */
.rounded-sm { border-radius: var(--radius-sm); }
.rounded-md { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-xl); }
.rounded-full { border-radius: var(--radius-full); }

/* ========================================
   Shadow Utilities
   ======================================== */
.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }
.shadow-glow { box-shadow: var(--shadow-glow); }

/* ========================================
   Interactive States
   ======================================== */
.hover-lift {
    transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.hover-glow {
    transition: box-shadow var(--transition-base);
}

.hover-glow:hover {
    box-shadow: var(--shadow-glow);
}

/* ========================================
   Focus States (Accessibility)
   ======================================== */
.focus-ring:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(6, 132, 102, 0.3);
}

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

/* ========================================
   Organic Shape Classes
   ======================================== */
.wave-divider {
    position: relative;
    width: 100%;
    overflow: hidden;
    line-height: 0;
}

.wave-divider svg {
    position: relative;
    display: block;
    width: calc(100% + 1.3px);
    height: 60px;
}

.wave-divider.wave-top {
    transform: rotate(180deg);
}

/* ========================================
   Card Component
   ======================================== */
.theme-card {
    background: var(--theme-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-base);
}

.theme-card:hover {
    box-shadow: var(--shadow-md);
}

.theme-card-interactive {
    cursor: pointer;
}

.theme-card-interactive:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

/* ========================================
   Button Components
   ======================================== */
.btn-theme-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--gradient-primary);
    color: var(--theme-text-inverse);
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: all var(--transition-base);
}

.btn-theme-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(6, 132, 102, 0.35);
}

.btn-theme-primary:active {
    transform: translateY(0);
}

.btn-theme-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-theme-accent {
    background: var(--gradient-accent);
}

.btn-theme-accent:hover {
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.35);
}

/* ========================================
   Input Components
   ======================================== */
.input-theme {
    width: 100%;
    padding: 14px 18px;
    background: var(--theme-card);
    border: 2px solid var(--theme-border);
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: 16px;
    color: var(--theme-text);
    transition: all var(--transition-fast);
}

.input-theme::placeholder {
    color: var(--theme-text-muted);
}

.input-theme:focus {
    outline: none;
    border-color: var(--theme-primary);
    box-shadow: 0 0 0 3px rgba(6, 132, 102, 0.15);
}

/* ========================================
   Badge Components
   ======================================== */
.badge-theme {
    display: inline-block;
    padding: 4px 12px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-primary {
    background: var(--theme-primary);
    color: var(--theme-text-inverse);
}

.badge-secondary {
    background: var(--theme-secondary-light);
    color: var(--theme-primary-dark);
}

.badge-accent {
    background: var(--theme-accent);
    color: var(--theme-text-inverse);
}

.badge-success {
    background: var(--theme-success);
    color: var(--theme-text-inverse);
}

.badge-warning {
    background: var(--theme-warning);
    color: var(--theme-text-inverse);
}

.badge-danger {
    background: var(--theme-danger);
    color: var(--theme-text-inverse);
}

/* ========================================
   RTL Support
   ======================================== */
[dir="rtl"] {
    font-family: var(--font-arabic);
}

[dir="rtl"] .font-display {
    font-family: var(--font-arabic);
}

/* ========================================
   Animation Keyframes
   ======================================== */
@keyframes pulse-teal {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(6, 132, 102, 0.4);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(6, 132, 102, 0);
    }
}

@keyframes glow-teal {
    0%, 100% {
        box-shadow: var(--shadow-md);
    }
    50% {
        box-shadow: var(--shadow-glow);
    }
}

@keyframes fade-in-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

.animate-fade-in-up {
    animation: fade-in-up 0.6s ease-out;
}

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

/* ========================================
   Print Styles
   ======================================== */
@media print {
    .no-print {
        display: none !important;
    }

    body {
        background: white !important;
        color: black !important;
    }
}
