/* ==================== CSS Variables ==================== */
:root {
    /* Colors */
    --bg-primary: #f5f7fa;
    --bg-secondary: #ffffff;
    --text-primary: #2c3e50;
    --text-secondary: #6c757d;
    --border-color: #e1e8ed;
    --accent-primary: #1983e0;
    --accent-secondary: #054e8e;
    --status-online: #28a745;
    --status-offline: #dc3545;
    --status-warning: #ffc107;

    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.15);

    /* Spacing scale */
    --spacing-xs: 0.25rem;  /* 4px */
    --spacing-sm: 0.5rem;   /* 8px */
    --spacing-md: 1rem;     /* 16px */
    --spacing-lg: 1.5rem;   /* 24px */
    --spacing-xl: 2rem;     /* 32px */
    --spacing-2xl: 3rem;    /* 48px */

    /* Border radius */
    --radius-sm: 0.5rem;    /* 8px - inputs, buttons, small elements */
    --radius-md: 0.75rem;   /* 12px - cards, sections */
    --radius-lg: 1.25rem;   /* 20px - large containers */
    --radius-full: 9999px;  /* Fully rounded (pills, circles) */

    /* Typography scale */
    --font-xs: 0.75rem;     /* 12px - helper text, captions */
    --font-sm: 0.875rem;    /* 14px - labels, small text */
    --font-base: 1rem;      /* 16px - body text, inputs */
    --font-md: 1.125rem;    /* 18px - emphasized text */
    --font-lg: 1.5rem;      /* 24px - section headings (h2) */
    --font-xl: 2rem;        /* 32px - large headings */
    --font-2xl: 3rem;       /* 48px - hero text, prices */

    /* Line heights */
    --line-height-tight: 1.25;
    --line-height-normal: 1.5;
    --line-height-relaxed: 1.75;

    /* Font weights */
    --font-normal: 400;
    --font-medium: 500;
    --font-semibold: 600;
    --font-bold: 700;
}

[data-theme="dark"] {
    --bg-primary: #1a1d23;
    --bg-secondary: #25292f;
    --text-primary: #e4e6eb;
    --text-secondary: #b0b3b8;
    --border-color: #3a3f47;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
}

/* ==================== Reset & Base ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* ==================== Header ==================== */
header {
    background-color: var(--bg-secondary);
    padding: 1.5rem 2rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    transition: background-color 0.3s ease;
}

header h1 {
    font-size: 1.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

header h1 i {
    color: var(--accent-primary);
}

.header-buttons {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.icon-button {
    background: none;
    border: 2px solid var(--border-color);
    color: var(--text-primary);
    width: 42px;
    height: 42px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.icon-button:hover {
    background-color: var(--bg-primary);
    transform: scale(1.1);
}

#theme-toggle:hover {
    transform: rotate(15deg) scale(1.1);
}

#cache-buster:hover {
    animation: spin 0.5s ease-in-out;
}

/* ==================== Main Content ==================== */
main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

/* ==================== Footer ==================== */
footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ==================== Loading Spinner ==================== */
.loading {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-secondary);
}

.loading i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--accent-primary);
}

.loading p {
    font-size: 1.1rem;
}

/* ==================== Form Elements ==================== */
input,
select,
textarea {
    width: 100%;
    padding: var(--spacing-md);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: var(--font-base);
    font-family: inherit;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(118, 75, 162, 0.1);
}

input::placeholder,
textarea::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
}

input:disabled,
select:disabled,
textarea:disabled {
    background-color: var(--bg-primary);
    cursor: not-allowed;
    opacity: 0.6;
}

label {
    display: block;
    margin-bottom: var(--spacing-sm);
    color: var(--text-primary);
    font-weight: var(--font-semibold);
    font-size: var(--font-sm);
}

/* ==================== Buttons ==================== */
.btn-primary {
    width: 100%;
    padding: var(--spacing-md) var(--spacing-lg);
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: var(--font-base);
    font-weight: var(--font-semibold);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    font-family: inherit;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* ==================== Responsive Design ==================== */
/*
 * Standard breakpoints used across all projects:
 * - Desktop: > 768px (default)
 * - Tablet: 481px - 768px
 * - Mobile: ≤ 480px
 *
 * Usage:
 * @media (max-width: 768px) { ... }  // Tablets and below
 * @media (max-width: 480px) { ... }  // Mobile only
 */

@media (max-width: 768px) {
    header {
        padding: 1rem 1.5rem;
    }

    header h1 {
        font-size: 1.4rem;
    }

    main {
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.2rem;
        gap: 0.5rem;
    }

    .icon-button {
        width: 38px;
        height: 38px;
        font-size: 1rem;
    }

    .header-buttons {
        gap: 0.5rem;
    }

    main {
        padding: 1rem;
    }
}

/* ==================== Animations ==================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.fa-spinner {
    animation: spin 1s linear infinite;
}

/* ==================== Utility Classes ==================== */
.gradient-bg {
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
}

.card {
    background-color: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

/* Card variants */
.card-elevated {
    box-shadow: var(--shadow-md);
    border: none;
}

.card-large {
    padding: var(--spacing-xl);
    border-radius: var(--radius-lg);
}

.card-compact {
    padding: var(--spacing-md);
}
