/* ==========================================
   VARIABLES Y RESET
   ========================================== */
:root {
    --ink:          #06060c;
    --surface:      rgba(18, 18, 42, 0.4);
    --panel:        rgba(26, 26, 58, 0.55);
    --card:         rgba(30, 30, 66, 0.5);
    --border:       rgba(255, 255, 255, 0.08);
    --border-hover: rgba(var(--p1-rgb), 0.5);
    --p1:           #7c5cfc;
    --p2:           #5b8dee;
    --p3:           #2dd4f7;
    --p1-rgb:       124, 92, 252;
    --p2-rgb:       91, 141, 238;
    --accent-bi:    #f2c811;
    --accent-xl:    #21b45c;
    --text:         #f4f2ff;
    --muted:        #9c94c9;
    --radius:       18px;
    
    /* Variables para fondos y capas */
    --bg-grad-1:    rgba(var(--p1-rgb), 0.15);
    --bg-grad-2:    rgba(45,212,247,0.1);
    --bg-grad-3:    rgba(var(--p2-rgb), 0.1);
    --grid-color:   rgba(255,255,255,0.015);
    --header-bg:    rgba(6, 6, 12, 0.7);
    --hero-title:   #fff;
    --reportes-bg:  rgba(6, 6, 12, 0.9);
    --card-title:   #fff;
    --nav-active:   #fff;
    --nav-inactive: var(--muted);
    
    --input-text:   #fff;
    --input-ph:     rgba(156, 148, 201, 0.6);
    --input-bg:     rgba(255,255,255,0.03);
    --input-border: rgba(255,255,255,0.06);
    
    --filter-bg:    rgba(255,255,255,0.03);
    --filter-border:rgba(255,255,255,0.06);
    --btn-active-bg:rgba(255,255,255,0.1);
    --btn-active-text: #fff;
    --btn-hover-bg: rgba(255,255,255,0.05);
}

[data-theme="corporate"] {
    --ink:          #f4f7f6;
    --surface:      rgba(255, 255, 255, 0.8);
    --panel:        rgba(255, 255, 255, 0.9);
    --card:         rgba(255, 255, 255, 0.85);
    --border:       rgba(0, 168, 150, 0.25);
    --border-hover: rgba(0, 168, 150, 0.9);
    --p1:           #009b8d; /* Teal oscuro de Semco */
    --p2:           #02c39a; /* Teal claro/esmeralda */
    --p3:           #05668d; /* Azul secundario */
    --p1-rgb:       0, 155, 141;
    --p2-rgb:       2, 195, 154;
    --text:         #2d3748;
    --muted:        #64748b;
    
    --bg-grad-1:    rgba(0,155,141,0.15);
    --bg-grad-2:    rgba(2,195,154,0.1);
    --bg-grad-3:    rgba(5,102,141,0.1);
    --grid-color:   rgba(0,168,150,0.05);
    --header-bg:    rgba(244, 247, 246, 0.85);
    --hero-title:   #009b8d;
    --reportes-bg:  rgba(255, 255, 255, 0.9);
    --card-title:   #1e293b;
    --nav-active:   #009b8d;
    --nav-inactive: #64748b;
    
    --input-text:   #1e293b;
    --input-ph:     rgba(100, 116, 139, 0.6);
    --input-bg:     rgba(255,255,255,0.6);
    --input-border: rgba(0, 168, 150, 0.2);
    
    --filter-bg:    rgba(255,255,255,0.6);
    --filter-border:rgba(0, 168, 150, 0.2);
    --btn-active-bg:rgba(0, 168, 150, 0.15);
    --btn-active-text: #009b8d;
    --btn-hover-bg: rgba(0, 168, 150, 0.05);
}

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

html {
    scroll-behavior: smooth;
}

body {
    background: var(--ink);
    color: var(--text);
    font-family: 'DM Sans', sans-serif;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* ==========================================
   BACKGROUND EFFECTS
   ========================================== */
.app-bg {
    position: fixed; inset: 0; z-index: 0; pointer-events: none;
    background:
        radial-gradient(circle at 15% 20%, var(--bg-grad-1) 0%, transparent 40%),
        radial-gradient(circle at 85% 70%, var(--bg-grad-2) 0%, transparent 40%),
        radial-gradient(circle at 50% 100%, var(--bg-grad-3) 0%, transparent 50%);
    animation: bg-pulse 15s ease-in-out infinite alternate;
    filter: blur(40px);
}

@keyframes bg-pulse {
    0%   { transform: scale(1) translate(0, 0); }
    50%  { transform: scale(1.1) translate(2%, 2%); }
    100% { transform: scale(1) translate(-2%, -2%); }
}

.grid-overlay {
    position: fixed; inset: 0; z-index: 0; pointer-events: none;
    background-image:
        linear-gradient(var(--grid-color) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-color) 1px, transparent 1px);
    background-size: 60px 60px;
    mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
    -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
}

/* ==========================================
   CONFETTI CANVAS
   ========================================== */
#confetti-canvas {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 1;
    pointer-events: none;
}

/* ==========================================
   HEADER
   ========================================== */
header {
    position: fixed; top: 0; left: 0; width: 100%; z-index: 100;
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 40px;
    background: var(--header-bg);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-bottom: 1px solid var(--border);
}

.header-brand {
    display: flex; align-items: center; gap: 14px;
}

.brand-icon {
    width: 44px; height: 44px;
    background: linear-gradient(135deg, var(--p1), var(--p2));
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.3rem;
    box-shadow: 0 6px 20px rgba(var(--p1-rgb), 0.4), inset 0 2px 4px rgba(255,255,255,0.3);
    animation: float 4s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-3px); }
}

.brand-text h1 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.15rem; font-weight: 800;
    background: linear-gradient(to right, var(--hero-title), var(--text));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    letter-spacing: -0.01em;
}

.brand-text span {
    font-size: 0.75rem; color: var(--muted); font-weight: 500;
    letter-spacing: 0.05em; text-transform: uppercase;
}

.header-nav {
    display: flex; gap: 8px;
}

.nav-link {
    padding: 8px 20px;
    border-radius: 10px;
    color: var(--muted);
    text-decoration: none;
    font-size: 0.9rem; font-weight: 600;
    transition: all 0.3s ease;
}

.nav-link:hover, .nav-link.active {
    color: #fff;
    background: rgba(255,255,255,0.08);
}

/* ==========================================
   HERO SECTION
   ========================================== */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    text-align: center;
    z-index: 2;
    padding: 130px 20px 60px; /* Increased top padding to prevent header overlap */
}

.hero-content {
    position: relative; z-index: 5;
}

.hero-content h2 {
    font-family: 'Outfit', sans-serif;
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 800; line-height: 1.3;
    letter-spacing: -0.02em;
    margin-bottom: 24px;
    color: var(--hero-title);
}

.hero-content h2 span {
    display: block;
    margin-top: 10px; /* Separated title lines slightly */
    background: linear-gradient(135deg, var(--p1), var(--p3));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}

.hero-content p {
    color: var(--muted); font-size: 1.1rem;
    max-width: 540px; line-height: 1.8;
    letter-spacing: 0.015em;
    margin: 0 auto 44px;
}

.hero-cta {
    display: inline-flex; align-items: center; gap: 10px;
    padding: 16px 40px;
    background: linear-gradient(135deg, var(--p1), var(--p2));
    color: #fff; font-weight: 700; font-size: 1rem;
    letter-spacing: 0.02em;
    border-radius: 14px;
    text-decoration: none;
    box-shadow: 0 8px 30px rgba(var(--p1-rgb), 0.4);
    transition: transform 0.3s, box-shadow 0.3s;
    animation: cta-glow 3s ease-in-out infinite;
}

@keyframes cta-glow {
    0%, 100% { box-shadow: 0 8px 30px rgba(var(--p1-rgb), 0.4); }
    50%      { box-shadow: 0 8px 50px rgba(var(--p1-rgb), 0.7), 0 0 20px rgba(var(--p2-rgb), 0.3); }
}

.hero-cta:hover {
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 12px 40px rgba(var(--p1-rgb), 0.6);
    animation: none;
}

.cta-arrow {
    font-size: 1.3rem;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40%  { transform: translateY(-6px); }
    60%  { transform: translateY(-3px); }
}

/* Cursor glow trail */
.cursor-glow {
    position: fixed;
    width: 300px; height: 300px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(var(--p1-rgb), 0.12) 0%, transparent 70%);
    pointer-events: none;
    z-index: 1;
    transform: translate(-50%, -50%);
    transition: left 0.4s ease-out, top 0.4s ease-out, opacity 0.4s;
    opacity: 0;
}

.cursor-glow.visible {
    opacity: 1;
}

/* ==========================================
   REPORTES SECTION
   ========================================== */
.reportes {
    position: relative; z-index: 10;
    padding: 80px 40px 60px;
    background: var(--reportes-bg);
    backdrop-filter: blur(16px);
    border-top: 1px solid var(--border);
}

.reportes-header {
    text-align: center;
    margin-bottom: 50px;
}

.section-title {
    font-family: 'Outfit', sans-serif;
    font-size: clamp(1.8rem, 3vw, 2.4rem);
    font-weight: 800;
    margin-bottom: 16px;
    letter-spacing: -0.01em;
    background: linear-gradient(135deg, var(--hero-title), var(--muted));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}

.section-subtitle {
    color: var(--muted); font-size: 1rem; margin-bottom: 30px;
    letter-spacing: 0.02em;
}

/* Controls: Search & Filters */
.report-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-top: 10px;
}

.search-box {
    display: flex;
    align-items: center;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 14px;
    padding: 5px 16px;
    min-width: 260px;
    transition: border-color 0.3s ease, background 0.3s ease;
}

.search-box:focus-within {
    border-color: var(--p1);
}

.search-icon {
    font-size: 1.1rem;
    color: var(--muted);
    margin-right: 10px;
}

#search-input {
    flex-grow: 1;
    background: transparent;
    border: none;
    color: var(--input-text);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.95rem;
    padding: 8px 0;
    outline: none;
}

#search-input::placeholder {
    color: var(--input-ph);
}

.filter-tabs {
    display: inline-flex; gap: 6px;
    background: var(--filter-bg);
    border: 1px solid var(--filter-border);
    border-radius: 14px;
    padding: 5px;
}

.filter-btn {
    padding: 10px 24px;
    border-radius: 10px;
    border: none;
    background: transparent;
    color: var(--muted);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.9rem; font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-btn.active {
    background: var(--btn-active-bg);
    color: var(--btn-active-text);
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.filter-btn:not(.active):hover {
    color: var(--text);
    background: var(--btn-hover-bg);
}

/* Cards Grid */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 24px;
    max-width: 1200px;
    margin: 0 auto 60px;
}

/* Report Card */
.report-card {
    position: relative;
    background: var(--card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    text-decoration: none;
    color: var(--text);
    display: flex; flex-direction: column;
    transition: transform 0.35s cubic-bezier(.4,0,.2,1),
                border-color 0.35s ease,
                box-shadow 0.35s ease,
                opacity 0.6s ease;
    cursor: pointer;
    /* Entrance animation */
    opacity: 0;
    transform: translateY(30px);
}

.report-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.report-card:hover {
    transform: translateY(-6px) scale(1.015);
    border-color: var(--border-hover);
    box-shadow: 0 20px 50px rgba(var(--p1-rgb), 0.25), 0 0 0 1px var(--border-hover);
}

.report-card.xl:hover {
    border-color: rgba(33,180,92,0.5);
    box-shadow: 0 20px 50px rgba(33,180,92,0.2), 0 0 0 1px rgba(33,180,92,0.5);
}

/* Shine effect */
.report-card::after {
    content: ''; position: absolute;
    top: 0; left: -100%; width: 60%; height: 100%;
    background: linear-gradient(to right, transparent, rgba(255,255,255,0.04), transparent);
    transform: skewX(-25deg);
    transition: left 0.7s ease;
    pointer-events: none;
}
.report-card:hover::after { left: 160%; }

.card-stripe {
    height: 4px; width: 100%;
    background: linear-gradient(90deg, var(--p1), var(--p2), var(--p3));
    transition: height 0.3s ease;
}
.report-card:hover .card-stripe { height: 6px; }
.card-stripe.xl { background: linear-gradient(90deg, #21b45c, #0d8a42); }

.card-body {
    padding: 28px 24px 24px;
    display: flex; flex-direction: column; flex-grow: 1;
}

.card-header-row {
    display: flex; align-items: flex-start; justify-content: space-between;
    margin-bottom: 16px;
}

.card-type-badge {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 12px; border-radius: 100px;
    font-size: 0.72rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.05em;
}
.badge-pbi { background: rgba(242,200,17,0.12); border: 1px solid rgba(242,200,17,0.25); color: #f2c811; }
.badge-xl  { background: rgba(33,180,92,0.12); border: 1px solid rgba(33,180,92,0.25); color: #21b45c; }

.card-icon-wrap {
    width: 48px; height: 48px; border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.4rem;
}
.icon-pbi { background: rgba(242,200,17,0.08); border: 1px solid rgba(242,200,17,0.15); }
.icon-xl  { background: rgba(33,180,92,0.08); border: 1px solid rgba(33,180,92,0.15); }

.card-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.15rem; font-weight: 700; color: var(--card-title);
    margin-bottom: 10px;
}

.card-desc {
    font-size: 0.88rem; color: var(--muted);
    line-height: 1.6;
    margin-bottom: 20px; flex-grow: 1;
}

.card-meta {
    display: flex; gap: 14px; flex-wrap: wrap;
    border-top: 1px solid var(--border);
    padding-top: 14px; margin-bottom: 18px;
}

.meta-item {
    display: flex; align-items: center; gap: 5px;
    font-size: 0.78rem; color: rgba(156,148,201,0.8); font-weight: 500;
}

.card-link-btn {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    padding: 12px 0; width: 100%;
    background: linear-gradient(90deg, var(--p1), var(--p2));
    color: #fff; font-weight: 700; font-size: 0.88rem;
    border-radius: 12px;
    transition: opacity 0.25s;
}
.report-card:hover .card-link-btn { opacity: 0.9; }

.card-link-btn.xl-btn {
    background: linear-gradient(90deg, #21b45c, #0d8a42);
}

/* Card hide for filter */
.report-card.hidden {
    display: none;
}

/* Stats Row */
.stats-row {
    display: flex; justify-content: center; gap: 24px;
    flex-wrap: wrap;
    max-width: 600px;
    margin: 0 auto;
}

.stat-box {
    display: flex; flex-direction: column; align-items: center;
    background: var(--card);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 18px 30px;
    min-width: 130px;
    transition: transform 0.3s ease;
}

.stat-box:hover {
    transform: translateY(-3px);
}

.stat-val {
    font-family: 'Outfit', sans-serif;
    font-size: 2rem; font-weight: 800;
    background: linear-gradient(90deg, var(--hero-title), var(--p2));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}

.stat-lbl {
    font-size: 0.82rem; color: var(--muted); margin-top: 4px; font-weight: 500;
}

/* ==========================================
   FOOTER
   ========================================== */
.site-footer {
    position: relative; z-index: 10;
    padding: 30px 20px;
    border-top: 1px solid var(--border);
    background: var(--header-bg);
}

.footer-content {
    max-width: 1000px;
    margin: 0 auto;
    display: flex; flex-direction: column; gap: 14px;
    align-items: center;
}

.footer-content p {
    color: var(--muted);
    font-size: 0.85rem;
}

.social-links {
    display: flex; gap: 24px;
}

.social-links a {
    color: var(--nav-inactive);
    text-decoration: none;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.9rem; font-weight: 600;
    transition: color 0.3s;
}

.social-links a:hover {
    color: var(--nav-active);
}

/* Theme Toggle Button */
.theme-toggle-btn {
    padding: 8px 18px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--p1), var(--p2));
    color: #fff;
    border: none;
    cursor: pointer;
    font-family: 'DM Sans', sans-serif;
    font-weight: 700;
    font-size: 0.85rem;
    margin-left: 10px;
    transition: opacity 0.3s, transform 0.3s, box-shadow 0.3s;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.theme-toggle-btn:hover {
    opacity: 0.9;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.2);
}

/* ==========================================
   RESPONSIVE
   ========================================== */
@media (max-width: 768px) {
    header { padding: 12px 20px; }
    .header-nav { display: none; }
    .hero { padding: 120px 20px 40px; }
    .reportes { padding: 60px 20px 40px; }
    .cards-grid { grid-template-columns: 1fr; }
    .stats-row { gap: 12px; }
    .stat-box { padding: 14px 20px; min-width: 100px; }
    .report-controls { flex-direction: column; width: 100%; }
    .search-box { width: 100%; min-width: unset; }
    .filter-tabs { flex-wrap: wrap; justify-content: center; width: 100%; }
}
