/* =============================================
   Despertar Espiral - Global Design System
   Palette: Black (#0A0A0A), Gold (#C9A84C), White
   Theme: Dark Luxury Premium
   ============================================= */

/* CSS Custom Properties */
:root {
    --bg-primary: #0A0A0A;
    --bg-secondary: #111111;
    --bg-card: #161616;
    --bg-card-hover: #1C1C1C;
    --bg-surface: #1A1A1A;
    --bg-elevated: #202020;
    --border-subtle: rgba(201, 168, 76, 0.12);
    --border-medium: rgba(201, 168, 76, 0.20);
    --border-strong: rgba(201, 168, 76, 0.35);
    --gold: #C9A84C;
    --gold-light: #DFC06A;
    --gold-dark: #A8893D;
    --gold-glow: rgba(201, 168, 76, 0.25);
    --gold-subtle: rgba(201, 168, 76, 0.08);
    --text-primary: #FFFFFF;
    --text-secondary: rgba(255, 255, 255, 0.72);
    --text-muted: rgba(255, 255, 255, 0.40);
    --text-faint: rgba(255, 255, 255, 0.20);
    --success: #34C759;
    --error: #FF453A;
    --warning: #FFD60A;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.4), 0 1px 2px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 20px rgba(0,0,0,0.5);
    --shadow-lg: 0 12px 40px rgba(0,0,0,0.6);
    --shadow-gold: 0 4px 20px rgba(201, 168, 76, 0.15);
    --glass-bg: rgba(255, 255, 255, 0.04);
    --glass-bg-strong: rgba(255, 255, 255, 0.06);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-border-weak: rgba(255, 255, 255, 0.06);
    --overlay-card-bg: rgba(17, 17, 17, 0.84);
    --overlay-card-border: rgba(201, 168, 76, 0.16);
    --overlay-card-text: #fff;
    --overlay-card-text-secondary: rgba(255, 255, 255, 0.70);
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --font-display: 'Playfair Display', Georgia, 'Times New Roman', serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color-scheme: dark;
}

html[data-theme='light'] {
    --bg-primary: #F6F6F8;
    --bg-secondary: #EFEFF4;
    --bg-card: #FFFFFF;
    --bg-card-hover: #F5F5F7;
    --bg-surface: #FAFAFC;
    --bg-elevated: #FFFFFF;
    --border-subtle: rgba(0, 0, 0, 0.08);
    --border-medium: rgba(0, 0, 0, 0.12);
    --border-strong: rgba(0, 0, 0, 0.22);
    --gold: #C9A84C;
    --gold-light: #DFC06A;
    --gold-dark: #A8893D;
    --gold-glow: rgba(201, 168, 76, 0.16);
    --gold-subtle: rgba(201, 168, 76, 0.10);
    --text-primary: #19140E;
    --text-secondary: rgba(25, 20, 14, 0.78);
    --text-muted: rgba(25, 20, 14, 0.56);
    --text-faint: rgba(25, 20, 14, 0.36);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 10px 30px rgba(0,0,0,0.10);
    --shadow-lg: 0 20px 50px rgba(0,0,0,0.12);
    --shadow-gold: 0 10px 30px rgba(201, 168, 76, 0.16);
    --glass-bg: rgba(255, 255, 255, 0.78);
    --glass-bg-strong: rgba(255, 255, 255, 0.86);
    --glass-border: rgba(0, 0, 0, 0.10);
    --glass-border-weak: rgba(0, 0, 0, 0.08);
    --overlay-card-bg: rgba(255, 255, 255, 0.90);
    --overlay-card-border: rgba(0, 0, 0, 0.10);
    --overlay-card-text: var(--text-primary);
    --overlay-card-text-secondary: var(--text-secondary);
    color-scheme: light;
}

/* Reset & Base */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; font-size: 16px; }

body {
    font-family: var(--font-body);
    color: var(--text-primary);
    background: var(--bg-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body.landing-page {
    background: var(--bg-primary);
}

body.sidebar-open {
    overflow: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--gold); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--gold-light); }

:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 3px;
}

/* Typography */
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.2; color: var(--text-primary); }

/* Container */
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.container-sm { max-width: 800px; margin: 0 auto; padding: 0 20px; }

/* Buttons */
.btn {
    display: inline-block;
    padding: 14px 32px;
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: transform var(--transition), box-shadow var(--transition), background-color var(--transition), color var(--transition), border-color var(--transition);
    border: none;
    text-decoration: none;
    letter-spacing: 0.3px;
    font-family: var(--font-body);
}

.btn-primary {
    background: linear-gradient(135deg, var(--gold), var(--gold-light));
    color: #0A0A0A;
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-gold);
    color: #0A0A0A;
}

.btn-gold {
    background: linear-gradient(135deg, var(--gold), var(--gold-light));
    color: #0A0A0A;
    font-weight: 700;
}
.btn-gold:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(201, 168, 76, 0.35);
    color: #0A0A0A;
}

.btn-outline {
    background: transparent;
    border: 1.5px solid var(--border-medium);
    color: var(--gold);
}
.btn-outline:hover {
    background: var(--gold-subtle);
    border-color: var(--gold);
    color: var(--gold-light);
}

.btn-sm { padding: 8px 18px; font-size: 13px; border-radius: var(--radius-sm); }
.btn-lg { padding: 18px 44px; font-size: 17px; letter-spacing: 0.5px; }
.btn-block { display: block; width: 100%; }
.btn-danger { background: var(--error); color: #fff; }
.btn-danger:hover { background: #E03E35; color: #fff; }

.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 40px;
    padding: 10px 14px;
    border-radius: 999px;
    border: 1px solid var(--border-medium);
    background: var(--glass-bg);
    color: var(--text-secondary);
    cursor: pointer;
    transition: transform var(--transition), border-color var(--transition), background-color var(--transition), color var(--transition), box-shadow var(--transition);
    font: inherit;
    backdrop-filter: blur(8px);
}

html[data-theme='light'] .theme-toggle {
    background: var(--glass-bg-strong);
}

.theme-toggle:hover {
    transform: translateY(-1px);
    border-color: var(--gold);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}

.theme-toggle-icon {
    width: 18px;
    text-align: center;
    color: var(--gold);
    font-size: 14px;
    line-height: 1;
}

.theme-toggle-text {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.2px;
}

/* Alerts */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    font-size: 14px;
    backdrop-filter: blur(6px);
}
.alert-error {
    background: rgba(255, 69, 58, 0.12);
    color: #FF6B63;
    border: 1px solid rgba(255, 69, 58, 0.25);
}
.alert-success {
    background: rgba(52, 199, 89, 0.12);
    color: #5CD67B;
    border: 1px solid rgba(52, 199, 89, 0.25);
}
.alert-info {
    background: var(--gold-subtle);
    color: var(--gold-light);
    border: 1px solid var(--border-subtle);
}

/* Form Elements */
.form-group { margin-bottom: 18px; }
.form-group label {
    display: block;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid rgba(255,255,255,0.10);
    border-radius: var(--radius-md);
    font-size: 15px;
    transition: border-color var(--transition), box-shadow var(--transition), background-color var(--transition);
    background: var(--bg-surface);
    color: var(--text-primary);
    font-family: var(--font-body);
}
.form-control::placeholder { color: var(--text-muted); }
.form-control:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px var(--gold-glow);
    background: var(--bg-elevated);
}
textarea.form-control { min-height: 120px; resize: vertical; }
select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23C9A84C' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}

/* Cards */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-subtle);
    overflow: hidden;
    transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}
.card:hover {
    transform: translateY(-4px);
    border-color: var(--border-medium);
    box-shadow: var(--shadow-lg);
}
.card-body { padding: 24px; }
.card-img { width: 100%; height: 200px; object-fit: cover; }

/* Badge */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.badge-purple {
    background: rgba(201, 168, 76, 0.12);
    color: var(--gold);
}
.badge-gold {
    background: rgba(201, 168, 76, 0.15);
    color: var(--gold-light);
    border: 1px solid rgba(201, 168, 76, 0.25);
}
.badge-green {
    background: rgba(52, 199, 89, 0.12);
    color: #5CD67B;
}
.badge-red {
    background: rgba(255, 69, 58, 0.12);
    color: #FF6B63;
}
.badge-gray {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-muted);
}

/* Grid */
.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); }

@media (max-width: 768px) {
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* Table */
.table-responsive { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
table th, table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
table th {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: var(--bg-surface);
}
table td { color: var(--text-secondary); }
table tr:hover { background: rgba(255,255,255,0.03); }

/* Pagination */
.pagination { display: flex; gap: 8px; justify-content: center; margin-top: 30px; }
.pagination a, .pagination span {
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    border: 1px solid rgba(255,255,255,0.10);
    color: var(--text-secondary);
    transition: border-color var(--transition), color var(--transition), background-color var(--transition);
}
.pagination a:hover {
    border-color: var(--gold);
    color: var(--gold);
}
.pagination .active {
    background: linear-gradient(135deg, var(--gold), var(--gold-light));
    color: #0A0A0A;
    border-color: var(--gold);
    font-weight: 600;
}

/* Utility */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 14px; }
.text-xs { font-size: 12px; }
.text-purple { color: var(--gold); }
.text-gold { color: var(--gold); }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }
.p-2 { padding: 16px; }
.p-3 { padding: 24px; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-center { display: flex; justify-content: center; align-items: center; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.hidden { display: none; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb { background: rgba(201, 168, 76, 0.3); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold); }

/* Selection */
::selection {
    background: rgba(201, 168, 76, 0.3);
    color: #fff;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation: none !important;
        transition-duration: 0.01ms !important;
        transition-delay: 0ms !important;
        scroll-behavior: auto !important;
    }
}

/* ========== AMBIENT BACKGROUND ========== */
.ambient-bg {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.ambient-bg::before,
.ambient-bg::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.4;
    animation: ambientFloat 20s ease-in-out infinite alternate;
}

.ambient-bg::before {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(201, 168, 76, 0.12) 0%, transparent 70%);
    top: -10%;
    right: -5%;
    animation-delay: 0s;
}

.ambient-bg::after {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(201, 168, 76, 0.08) 0%, transparent 70%);
    bottom: -10%;
    left: -5%;
    animation-delay: -10s;
}

html[data-theme='light'] .ambient-bg::before {
    background: radial-gradient(circle, rgba(201, 168, 76, 0.08) 0%, transparent 70%);
    opacity: 0.5;
}

html[data-theme='light'] .ambient-bg::after {
    background: radial-gradient(circle, rgba(201, 168, 76, 0.06) 0%, transparent 70%);
    opacity: 0.5;
}

@keyframes ambientFloat {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(30px, -20px) scale(1.05); }
    100% { transform: translate(-20px, 15px) scale(0.95); }
}

@media (prefers-reduced-motion: reduce) {
    .ambient-bg::before,
    .ambient-bg::after {
        animation: none;
    }
}
