/* UnoEsMarketing - Central Style Sheet
   Optimized for: Scalability, Dark Mode Automation, and Readability.
   Structure: Tokens > Base > Layout > Components > Pages > Utilities
*/

/* =========================================
   1. TOKENS & VARIABLES (The Source of Truth)
   ========================================= */

:root {
    /* --- Psychology-Driven Palette --- */
    --brand-deep: #011C26;       /* Authority & Security */
    --brand-slate: #345259;      /* Professional Trust */
    --brand-teal: #61848C;       /* Calm Clarity */
    --brand-soft: #9FB9BF;       /* Breathable Space */
    --accent: #A6430A;           /* Sophisticated Action (Burnt Orange) */
    --accent-hover: #8B3808;

    /* --- UI Colors (Light Mode) --- */
    --bg-main: #FDFDFD;          /* High-clarity white */
    --bg-subtle: #F2F5F6;        /* Subtle contrast section */
    --bg-accent-subtle: #E8EEF0; /* Secondary contrast section */
    --bg-surface: #ffffff;
    
    --text-main: #011C26;        /* Deep prussian for readability */
    --text-muted: #345259;       /* Slate for sub-info */
    --text-label: #61848C;       /* Teal for labels */
    --text-inverse: #F2F5F6;

    /* --- Borders & Glass --- */
    --border-color: rgba(1, 28, 38, 0.08);
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(1, 28, 38, 0.1);
    --shadow-premium: 0 20px 40px -10px rgba(1, 28, 38, 0.05);

    /* --- Typography Scale (Golden Ratio) --- */
    --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.8rem);
    --text-sm: clamp(0.875rem, 0.825rem + 0.25vw, 0.95rem);
    --text-base: clamp(1rem, 0.95rem + 0.3vw, 1.125rem);
    --text-lg: clamp(1.2rem, 1.1rem + 0.4vw, 1.35rem);
    --text-xl: clamp(1.5rem, 1.35rem + 0.6vw, 1.8rem);
    --text-2xl: clamp(2rem, 1.8rem + 0.8vw, 2.5rem);
    --text-3xl: clamp(2.5rem, 2.2rem + 1.2vw, 3.5rem);
    --text-4xl: clamp(3.5rem, 3rem + 2vw, 5rem);
    --text-hero: clamp(4rem, 3.5rem + 4vw, 7rem);

    /* --- Hero Gradients --- */
    --hero-1: rgba(242, 242, 242, 0.4);
    --hero-2: rgba(217, 217, 217, 0.4);
}

/* --- Dark Mode Variables Override --- 
   By changing variables here, we avoid specific override selectors later.
*/
body.dark-mode {
    /* --- UI Colors (Dark Mode) --- */
    --bg-main: #011C26;          /* Deep Prussian Anchor */
    --bg-subtle: #052631;        /* Slightly lighter deep blue */
    --bg-accent-subtle: #0A2E39; 
    --bg-surface: #0a2029;
    --bg-nav: rgba(1, 28, 38, 0.9);
    --bg-footer: #000a0e;

    /* Variables Adaptativas (Dark Mode) */
    --text-main: #9FB9BF;        /* Soft Blue/Grey for text */
    --text-muted: #61848C;       /* Teal for secondary */
    --text-label: #345259;       /* Slate for labels */
    
    /* Borders & Glass (Dark Mode) */
    --border-color: rgba(159, 185, 191, 0.1);
    --glass-bg: rgba(5, 38, 49, 0.85);
    --glass-border: rgba(159, 185, 191, 0.15);
    --shadow-premium: 0 25px 50px -12px rgba(0, 0, 0, 0.5);

    /* --- Hero Gradients (Dark) --- */
    --hero-1: rgba(166, 67, 10, 0.1); /* Subtle rust glow */
    --hero-2: rgba(1, 28, 38, 0.8);
}

/* =========================================
   2. BASE & RESET
   ========================================= */

body {
    font-family: 'Quicksand', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.7;
    font-size: var(--text-base);
    font-weight: 500;
    overflow-x: hidden;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    letter-spacing: 0.01em;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Typography */
h1, h2, h3, h4, h5, h6, .font-heading {
    font-family: 'Playfair Display', serif;
    font-weight: 900;
    line-height: 1.1;
    letter-spacing: -0.04em;
    color: var(--brand-dark); /* Falls back to text-main in dark mode context via specificity if needed, but usually headings stay emphatic */
}

/* Dark mode specific fix for headings if variable isn't enough */
body.dark-mode h1, 
body.dark-mode h2, 
body.dark-mode h3, 
body.dark-mode h4 {
    color: var(--text-main);
}

h1 { font-size: var(--text-4xl); margin-bottom: 2.5rem; }
h2 { font-size: var(--text-3xl); margin-bottom: 2rem; }
h3 { font-size: var(--text-2xl); margin-bottom: 1.5rem; }
p { margin-bottom: 1.75rem; }

/* Custom Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-main); }
::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent-hover); }

/* =========================================
   3. LAYOUT (Nav & Footer)
   ========================================= */

nav {
    background-color: var(--bg-nav);
    border-bottom: 2.5px solid var(--accent);
    transition: all 0.4s ease;
    z-index: 1000;
}

/* Dark mode border fix logic handled by variable would be ideal, but border width differs */
body.dark-mode nav {
    border-bottom: 1px solid var(--glass-border);
}

nav .nav-link {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--text-muted);
    transition: all 0.3s ease;
}

nav .nav-link:hover,
nav .nav-link.active {
    color: var(--accent) !important;
}

body.dark-mode nav .nav-link {
    color: var(--text-muted);
}

footer {
    background-color: var(--bg-surface) !important;
    color: var(--text-muted) !important;
    padding: 6rem 0 3rem;
    position: relative;
    overflow: hidden;
    border-top: 1px solid var(--border-color);
}

body.dark-mode footer {
    background-color: var(--bg-main) !important;
    border-top: 1px solid var(--glass-border) !important;
}

footer .footer-accent-line {
    position: absolute;
    top: 0; left: 0;
    width: 6rem; height: 4px;
    background-color: var(--accent);
}

footer h2, footer h3, footer h4 {
    color: var(--text-main) !important;
}

footer a {
    color: var(--text-muted) !important;
}

footer a:hover { color: var(--accent) !important; }

footer .footer-bottom {
    background-color: rgba(0,0,0,0.2);
    padding: 1.5rem 0;
    margin-top: 4rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

footer .footer-logo {
    filter: brightness(0) invert(1);
    opacity: 0.9;
    margin-bottom: 2rem;
}

/* =========================================
   4. COMPONENTS
   ========================================= */

/* --- Buttons --- */
.btn-premium {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
    color: white !important;
    padding: 1rem 2.25rem;
    border-radius: 6px;
    font-weight: 900;
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: 0.2em;
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    border: none;
    box-shadow: 0 15px 35px rgba(255, 90, 31, 0.25);
    position: relative;
    z-index: 1;
    overflow: hidden;
}

.btn-premium::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: linear-gradient(rgba(255, 255, 255, 0.1), transparent);
    z-index: -1;
}

.btn-premium:hover {
    transform: translateY(-4px);
    box-shadow: 0 25px 50px rgba(255, 90, 31, 0.35);
    filter: brightness(1.05);
}

.btn-premium:active { transform: translateY(-1px); }

.btn-outline {
    border: 1.5px solid var(--brand-dark);
    color: var(--brand-dark);
    padding: 1rem 2.25rem;
    border-radius: 6px;
    font-weight: 800;
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    transition: all 0.4s ease;
    background: transparent;
}

/* Handle dark mode outline button specifically */
body.dark-mode .btn-outline {
    border-color: var(--text-main);
    color: var(--text-main);
}

.btn-outline:hover {
    background: var(--brand-dark);
    color: var(--primary);
    border-color: var(--brand-dark);
    transform: translateY(-2px);
}

body.dark-mode .btn-outline:hover {
    background: var(--text-main);
    color: var(--bg-main);
    border-color: var(--text-main);
}

/* --- Cards & Glass --- */
.glass-box, .glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-premium);
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    border-radius: 12px;
}

.glass-box:hover, .glass-panel:hover {
    border-color: var(--accent);
    transform: translateY(-8px);
    box-shadow: 0 40px 80px -20px rgba(15, 23, 42, 0.12);
}

.stat-card {
    border-left: 2px solid var(--accent);
    padding-left: 1.5rem;
}

.text-label {
    font-size: var(--text-xs);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--text-label);
}

/* --- Typography Helpers --- */
.section-subtitle {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.4em;
    color: var(--accent);
    margin-bottom: 1rem;
    display: block;
}

body.dark-mode .section-subtitle {
    color: var(--accent);
}

.section-title {
    font-family: 'Playfair Display', serif;
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 900;
    line-height: 1.1;
    margin-bottom: 2rem;
    color: var(--brand-deep); /* Changed for Authority */
}

/* Override explícito para títulos en Modo Oscuro */
body.dark-mode .section-title {
    color: var(--text-main);
}

.section-description {
    font-size: 1.125rem;
    color: var(--text-muted);
    max-width: 42rem;
    margin-left: auto;
    margin-right: auto;
    font-weight: 300;
}

.card-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--brand-deep); /* Changed for Authority */
    margin-bottom: 0.5rem;
    transition: color 0.3s ease;
}

/* Opcional: El título de tarjeta cambia a un tono más mudo en modo oscuro */
body.dark-mode .card-title {
    color: var(--text-main);
}

.card-description {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-bottom: 1.5rem;
    display: block;
}

.check-list {
    list-style: none;
    padding: 0;
    margin: 0 0 2rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.check-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.check-item i {
    color: var(--accent-success);
    font-size: 0.75rem;
}

.icon-box {
    width: 5rem;
    height: 5rem;
    margin-left: auto;
    margin-right: auto;
    background-color: var(--bg-main);
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    color: var(--text-label);
    transition: all 0.3s ease;
}

.glass-box:hover .icon-box {
    background-color: rgba(255, 90, 31, 0.1);
    color: var(--accent);
}

/* =========================================
   5. PAGE SPECIFIC STYLES
   ========================================= */

/* --- Home / General --- */
.hero-gradient {
    background: radial-gradient(circle at 100% 0%, var(--hero-1) 0%, transparent 50%),
                radial-gradient(circle at 0% 100%, var(--hero-2) 0%, transparent 50%);
}

.vertical-card {
    position: relative;
    height: 400px;
    overflow: hidden;
    border-radius: 4px;
    box-shadow: var(--shadow-premium);
}

.vertical-image {
    width: 100%; height: 100%;
    object-fit: cover;
    filter: grayscale(100%) contrast(1.1);
    transition: all 0.8s ease;
}

.vertical-card:hover .vertical-image {
    filter: grayscale(0%) contrast(1);
    transform: scale(1.1);
}

.vertical-content {
    position: absolute;
    bottom: 0; left: 0;
    width: 100%;
    padding: 2.5rem;
    background: linear-gradient(to top, rgba(15, 23, 42, 0.95) 0%, transparent 100%);
    z-index: 10;
}

.vertical-content h4 { color: #ffffff !important; margin-bottom: 0.5rem; }

.ad-preview {
    border: 1px dashed var(--glass-border);
    padding: 0.5rem;
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.03);
}

body.dark-mode .ad-preview { background: rgba(255, 255, 255, 0.03); }

/* --- Dashboard --- */
.dashboard-body { background-color: var(--bg-main); }

.folder-card {
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: pointer;
    border: 1px solid transparent;
}

.folder-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-premium);
    border-color: var(--accent);
    background: var(--bg-surface);
}

/* Roles */
.role-badge-ceo { background-color: #fef3c7; color: #b45309; border: 1px solid #fcd34d; }
.role-badge-coo { background-color: #dbeafe; color: #1e40af; border: 1px solid #bfdbfe; }
.role-badge-cfo { background-color: #dcfce7; color: #15803d; border: 1px solid #86efac; }

/* --- Index Page (Specific Dark Aesthetics) --- */
.index-body {
    background-color: var(--bg-charcoal);
    color: #f8fafc;
}

.glass-card {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.glass-card:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--accent);
    transform: translateY(-5px);
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.5);
}

.nav-link-index {
    position: relative;
    transition: color 0.3s ease;
}

.nav-link-index::after {
    content: '';
    position: absolute;
    bottom: -5px; left: 0;
    width: 0; height: 2px;
    background: var(--accent);
    transition: width 0.3s ease;
}

.nav-link-index:hover::after { width: 100%; }

.text-gradient {
    background: linear-gradient(to right, #fff, #94a3b8);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* --- Legal Pages --- */
.legal-container { max-width: 800px; margin: 0 auto; padding: 80px 24px 60px; }
.policy-section { margin-bottom: 40px; }
.policy-section h2 { font-size: 1.5rem; margin-bottom: 1rem; font-weight: 700; }
.policy-section p { line-height: 1.6; color: var(--text-muted); margin-bottom: 1rem; }
.legal-footer { border-top: 1px solid var(--border-color); padding: 40px 0; background: var(--bg-surface); }

/* =========================================
   6. UTILITIES & OVERRIDES
   ========================================= */

.animate-float { animation: float 6s ease-in-out infinite; }
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

.category-tag {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 800;
    padding: 4px 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    color: var(--accent);
}

/* Framework/Library Overrides (Tailwind Interop compatibility) 
   Handling these via variables removes the need for !important in many cases.
*/

body.dark-mode .text-slate-900,
body.dark-mode .text-slate-800,
body.dark-mode .text-slate-700 { color: var(--text-main) !important; }

body.dark-mode .text-slate-500,
body.dark-mode .text-slate-400 { color: var(--text-muted) !important; }

body.dark-mode .border-slate-200, 
body.dark-mode .border-slate-100 { border-color: var(--border-color) !important; }

/* Image Filters for Dark Mode */
body.dark-mode .logo-main,
body.dark-mode img[src*="logo"] { filter: brightness(0) invert(1) !important; }
body.dark-mode .grayscale { filter: none !important; }
body.dark-mode .brightness-0 { filter: brightness(0) invert(1) !important; }

/* Form Elements */
body.dark-mode input, 
body.dark-mode textarea, 
body.dark-mode select {
    background-color: rgba(255, 255, 255, 0.03) !important;
    color: var(--text-main) !important;
    border-color: var(--glass-border) !important;
}