/**
 * PeptideVerify Site-Wide CSS
 * Complete unified design system with strategic liquid glass effects
 *
 * This file combines:
 * - Standard foundation (colors, typography, components)
 * - Strategic glass effects (used sparingly for impact)
 * - Site-specific components (nav, footer, etc.)
 *
 * Usage: Replace all individual CSS files with this single import
 * <link rel="stylesheet" href="/css/peptideverify.css">
 */

/* ========================================
   FOUNDATION - RESET & BASE
   ======================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ========================================
   COLOR SYSTEM - BRAND & FLIPPING GRAYS
   ======================================== */

:root {
    /* Brand Colors - Always the same */
    --brand-600: #2563eb;
    --brand-700: #1d4ed8;
    --brand-800: #1e40af;
    --brand-50: #eff6ff;
    --brand-100: #dbeafe;
    --brand-200: #bfdbfe;

    /* Gray Scale - Flips for dark mode */
    --gray-900: #0f172a;
    --gray-800: #1e293b;
    --gray-700: #334155;
    --gray-600: #475569;
    --gray-500: #64748b;
    --gray-400: #94a3b8;
    --gray-300: #cbd5e1;
    --gray-200: #e2e8f0;
    --gray-100: #f1f5f9;
    --gray-50: #f8fafc;

    /* Semantic Colors */
    --success: #10b981;
    --success-light: #d1fae5;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --error: #ef4444;
    --error-light: #fee2e2;
    --info: #3b82f6;
    --info-light: #dbeafe;

    /* Aliases for easy use */
    --text-primary: var(--gray-900);
    --text-secondary: var(--gray-600);
    --text-muted: var(--gray-500);
    --bg-primary: var(--gray-50);
    --bg-card: #ffffff;
    --bg-subtle: var(--gray-100);
    --border: var(--gray-200);
    --border-light: var(--gray-300);
    --accent: var(--brand-600);
}

/* Dark Mode - Flip the grays */
[data-theme="dark"] {
    --gray-900: #f8fafc;
    --gray-800: #e2e8f0;
    --gray-700: #cbd5e1;
    --gray-600: #94a3b8;
    --gray-500: #64748b;
    --gray-400: #475569;
    --gray-300: #334155;
    --gray-200: #1e293b;
    --gray-100: #0f172a;
    --gray-50: #020617;

    --bg-primary: #0a0e1a;
    --bg-card: #1a1f2e;
    --bg-subtle: #0f172a;
}

/* ========================================
   TYPOGRAPHY
   ======================================== */

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.7;
    font-size: 15px;
    transition: background-color 0.3s ease, color 0.3s ease;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1 {
    font-size: 42px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.2;
    letter-spacing: -0.02em;
}

h2 {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
    letter-spacing: -0.01em;
}

h3 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.4;
}

h4 {
    font-size: 20px;
    font-weight: 600;
    color: var(--gray-800);
    line-height: 1.4;
}

h5 {
    font-size: 18px;
    font-weight: 600;
    color: var(--gray-800);
    line-height: 1.5;
}

h6 {
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-800);
    line-height: 1.5;
}

p {
    margin-bottom: 16px;
    color: var(--text-secondary);
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--brand-700);
}

/* Override link styles for button elements */
a.btn {
    color: inherit;
}

/* Ensure primary buttons always have white text */
.btn-primary,
.btn-primary:hover,
a.btn-primary,
a.btn-primary:hover {
    color: white !important;
}

strong {
    font-weight: 600;
    color: var(--text-primary);
}

/* ========================================
   LAYOUT & CONTAINERS
   ======================================== */

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
}

.container-narrow {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 24px;
}

.container-sm {
    max-width: 700px;
    margin: 0 auto;
    padding: 0 24px;
}

.section {
    padding: 80px 24px;
}

.section-alt {
    background: var(--bg-subtle);
}

/* ========================================
   CARDS - CLEAN SOLID BACKGROUNDS
   ======================================== */

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 32px;
    transition: all 0.3s ease;
}

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

.card-sm {
    padding: 20px;
    border-radius: 10px;
}

.card-lg {
    padding: 48px;
    border-radius: 16px;
}

/* ========================================
   LIQUID GLASS - STRATEGIC USE ONLY
   Use for: hero sections, featured content, nav
   ======================================== */

.glass-light {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px) saturate(200%) brightness(1.05);
    -webkit-backdrop-filter: blur(20px) saturate(200%) brightness(1.05);
    border: 0.5px solid rgba(37, 99, 235, 0.12);
    box-shadow:
        0 8px 32px rgba(37, 99, 235, 0.12),
        0 2px 8px rgba(37, 99, 235, 0.06),
        inset 0 0 0 1px rgba(255, 255, 255, 0.5),
        inset 0 1px 0 0 rgba(255, 255, 255, 0.8);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] .glass-light {
    background: rgba(26, 31, 46, 0.45);
    border: 0.5px solid rgba(255, 255, 255, 0.08);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.4),
        0 2px 8px rgba(0, 0, 0, 0.2),
        inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.glass-medium {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(30px) saturate(200%) brightness(1.08);
    -webkit-backdrop-filter: blur(30px) saturate(200%) brightness(1.08);
    border: 0.5px solid rgba(37, 99, 235, 0.18);
    box-shadow:
        0 16px 48px rgba(37, 99, 235, 0.15),
        0 4px 16px rgba(37, 99, 235, 0.08),
        0 1px 4px rgba(37, 99, 235, 0.06),
        inset 0 0 0 1px rgba(255, 255, 255, 0.6),
        inset 0 2px 0 0 rgba(255, 255, 255, 0.9);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] .glass-medium {
    background: rgba(26, 31, 46, 0.6);
    border: 0.5px solid rgba(255, 255, 255, 0.12);
    box-shadow:
        0 16px 48px rgba(0, 0, 0, 0.5),
        0 4px 16px rgba(0, 0, 0, 0.3),
        inset 0 0 0 1px rgba(255, 255, 255, 0.08),
        inset 0 1px 0 0 rgba(255, 255, 255, 0.1);
}

.glass-hover:hover {
    transform: translateY(-2px);
}

.glass-light:hover {
    background: rgba(255, 255, 255, 0.92);
}

[data-theme="dark"] .glass-light:hover {
    background: rgba(26, 31, 46, 0.55);
}

.glass-medium:hover {
    background: rgba(255, 255, 255, 0.95);
}

[data-theme="dark"] .glass-medium:hover {
    background: rgba(26, 31, 46, 0.7);
}

/* Glass utilities */
.glass-rounded-sm { border-radius: 12px; }
.glass-rounded-md { border-radius: 16px; }
.glass-rounded-lg { border-radius: 20px; }
.glass-rounded-xl { border-radius: 24px; }

.glass-padding-sm { padding: 16px; }
.glass-padding-md { padding: 24px; }
.glass-padding-lg { padding: 32px; }
.glass-padding-xl { padding: 48px; }

/* ========================================
   BUTTONS
   ======================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, var(--brand-600) 0%, var(--brand-700) 100%);
    color: white;
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(37, 99, 235, 0.3);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--bg-subtle);
    border-color: var(--accent);
}

.btn-outline {
    background: transparent;
    color: var(--accent);
    border: 2px solid var(--accent);
}

.btn-outline:hover {
    background: var(--brand-50);
}

[data-theme="dark"] .btn-outline:hover {
    background: rgba(37, 99, 235, 0.1);
}

.btn-lg {
    padding: 16px 32px;
    font-size: 17px;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 14px;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* ========================================
   FORMS
   ======================================== */

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
    font-size: 14px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="url"],
input[type="tel"],
textarea,
select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    color: var(--text-primary);
    background: var(--bg-card);
    transition: all 0.2s ease;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

input::placeholder,
textarea::placeholder {
    color: var(--gray-400);
}

textarea {
    min-height: 120px;
    resize: vertical;
}

/* Prevent iOS zoom */
@media (max-width: 640px) {
    input,
    textarea,
    select {
        font-size: 16px;
    }
}

/* ========================================
   BADGES & LABELS
   ======================================== */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 100px;
    white-space: nowrap;
}

.badge-primary {
    background: var(--brand-100);
    color: var(--brand-700);
    border: 1px solid var(--brand-200);
}

.badge-success {
    background: var(--success-light);
    color: var(--success);
}

.badge-warning {
    background: var(--warning-light);
    color: var(--warning);
}

.badge-error {
    background: var(--error-light);
    color: var(--error);
}

/* ========================================
   NAVIGATION
   ======================================== */

.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.78);
    backdrop-filter: blur(30px) saturate(180%);
    -webkit-backdrop-filter: blur(30px) saturate(180%);
    border-bottom: 0.5px solid rgba(255, 255, 255, 0.18);
    box-shadow:
        0 2px 16px rgba(37, 99, 235, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
    transition: all 0.3s ease;
}

[data-theme="dark"] .nav {
    background: rgba(10, 14, 26, 0.78);
    border-bottom: 0.5px solid rgba(255, 255, 255, 0.08);
    box-shadow:
        0 2px 16px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* ========================================
   UTILITIES
   ======================================== */

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.text-brand { color: var(--accent); }

.mt-xs { margin-top: 8px; }
.mt-sm { margin-top: 16px; }
.mt-md { margin-top: 24px; }
.mt-lg { margin-top: 32px; }
.mt-xl { margin-top: 48px; }

.mb-xs { margin-bottom: 8px; }
.mb-sm { margin-bottom: 16px; }
.mb-md { margin-bottom: 24px; }
.mb-lg { margin-bottom: 32px; }
.mb-xl { margin-bottom: 48px; }

.grid {
    display: grid;
    gap: 24px;
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.flex {
    display: flex;
    gap: 16px;
}

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.flex-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 968px) {
    h1 { font-size: 36px; }
    h2 { font-size: 28px; }
    h3 { font-size: 22px; }

    .section { padding: 60px 24px; }

    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    h1 { font-size: 32px; }
    h2 { font-size: 24px; }
    h3 { font-size: 20px; }

    .section { padding: 40px 20px; }
    .card { padding: 24px; }

    .container,
    .container-narrow,
    .container-sm {
        padding: 0 16px;
    }

    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }

    .flex {
        flex-direction: column;
    }
}

/* ========================================
   ANIMATIONS
   ======================================== */

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

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

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