/* =========================================
   TRIBUS APP — DESIGN SYSTEM v2.0
   Premium Dark Theme / Glassmorphism
   ========================================= */

:root {
    --bg-dark: #08080f;
    --bg-surface: #10101c;
    --glass-bg: rgba(16, 16, 30, 0.72);
    --glass-border: rgba(255, 255, 255, 0.06);
    --glass-border-hover: rgba(255, 255, 255, 0.12);
    --neon-purple: #b5179e;
    --neon-blue: #4cc9f0;
    --neon-pink: #f72585;
    --neon-green: #00f5d4;
    --text-main: #eef0f4;
    --text-muted: #5e6a7a;
    --text-subtle: #3a4452;
    --accent-glow: rgba(76, 201, 240, 0.25);
    --accent-gradient: linear-gradient(135deg, #4cc9f0 0%, #7209b7 100%);
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 24px;
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

/* Headings get Outfit */
h1, h2, h3, h4 {
    font-family: 'Outfit', 'Inter', system-ui, sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    background-image: 
        radial-gradient(ellipse at 15% 50%, rgba(114, 9, 183, 0.08), transparent 50%),
        radial-gradient(ellipse at 85% 20%, rgba(76, 201, 240, 0.06), transparent 50%),
        radial-gradient(ellipse at 50% 100%, rgba(247, 37, 133, 0.04), transparent 50%);
    background-attachment: fixed;
}

.app-container {
    display: flex;
    min-height: 100vh;
}

/* =========================================
   SIDEBAR
   ========================================= */
.sidebar {
    width: 260px;
    background: linear-gradient(180deg, rgba(14, 12, 24, 0.92) 0%, rgba(8, 8, 15, 0.98) 100%);
    border-right: 1px solid var(--glass-border);
    padding: 1.5rem 1.2rem;
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 2rem;
    transition: var(--transition-bounce);
}

.logo:hover {
    transform: scale(1.03);
}

.logo img {
    filter: drop-shadow(0 0 12px rgba(76, 201, 240, 0.25));
    transition: filter var(--transition-smooth);
}

.logo:hover img {
    filter: drop-shadow(0 0 20px rgba(76, 201, 240, 0.45));
}

.sidebar nav {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.sidebar nav a {
    color: var(--text-muted);
    text-decoration: none;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
    font-size: 0.88rem;
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
    border-left: 2px solid transparent;
}

.sidebar nav a::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, rgba(255,255,255,0.04), transparent);
    opacity: 0;
    transition: opacity var(--transition-fast);
    z-index: -1;
}

.sidebar nav a:hover::before, .sidebar nav a.active::before {
    opacity: 1;
}

.sidebar nav a:hover, .sidebar nav a.active {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.03);
    border-left-color: var(--neon-blue);
    transform: translateX(3px);
}

.sidebar nav a i {
    font-size: 1rem;
    width: 20px;
    text-align: center;
    transition: transform var(--transition-fast);
}

.sidebar nav a:hover i {
    transform: scale(1.15);
}

/* =========================================
   MAIN CONTENT
   ========================================= */
.main-content {
    flex: 1;
    padding: 2rem 3rem;
    overflow-y: auto;
    position: relative;
}

.top-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    animation: fadeInDown 0.6s ease-out;
}

.top-header h1 {
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #ffffff 0%, #a0a0b0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.3rem;
    line-height: 1.2;
}

.top-header p {
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 400;
}

.content-grid {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

#inputs-wrapper {
    display: grid; 
    grid-template-columns: 1fr 1fr; 
    gap: 2rem; 
    width: 100%;
}

.input-section {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

/* =========================================
   GLASS PANELS (Core UI Component)
   ========================================= */
.glass-panel {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    padding: 2rem;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    transition: border-color var(--transition-smooth), box-shadow var(--transition-smooth);
}

.glass-panel:hover {
    border-color: var(--glass-border-hover);
    box-shadow: 
        0 12px 40px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.glass-panel h3 {
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.25rem;
    color: var(--text-main);
    font-weight: 700;
}

.glass-panel h3 i {
    color: var(--neon-blue);
    filter: drop-shadow(0 0 6px var(--accent-glow));
}

/* =========================================
   FORMS
   ========================================= */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-muted);
    letter-spacing: 0.3px;
}

input[type="text"], input[type="password"], input[type="email"], textarea, select {
    width: 100%;
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: var(--radius-md);
    color: var(--text-main);
    font-size: 0.92rem;
    outline: none;
    transition: all var(--transition-fast);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.15);
}

input[type="text"]:focus, input[type="password"]:focus, input[type="email"]:focus, textarea:focus, select:focus {
    border-color: var(--neon-blue);
    background: rgba(0, 0, 0, 0.5);
    box-shadow: 0 0 0 3px rgba(76, 201, 240, 0.1), inset 0 2px 4px rgba(0,0,0,0.2);
}

input::placeholder, textarea::placeholder {
    color: rgba(255, 255, 255, 0.2);
}

.file-upload {
    border: 2px dashed rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    padding: 2rem 1.5rem;
    text-align: center;
    cursor: pointer;
    background: rgba(0,0,0,0.15);
    transition: all var(--transition-fast);
}

.file-upload:hover {
    border-color: var(--neon-blue);
    background: rgba(76, 201, 240, 0.04);
    transform: scale(1.01);
}

.file-upload i {
    font-size: 2.2rem;
    color: var(--neon-blue);
    margin-bottom: 0.8rem;
    filter: drop-shadow(0 0 8px var(--accent-glow));
    transition: transform var(--transition-fast);
}

.file-upload:hover i {
    transform: translateY(-4px);
}

/* =========================================
   BUTTONS
   ========================================= */
.btn-neon {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #4cc9f0 0%, #4361ee 100%);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.3px;
    cursor: pointer;
    transition: all var(--transition-bounce);
    box-shadow: 0 6px 20px rgba(67, 97, 238, 0.25);
    position: relative;
    overflow: hidden;
}

.btn-neon::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(to bottom right, rgba(255,255,255,0) 0%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0) 100%);
    transform: rotate(45deg) translateY(-100%);
    transition: transform 0.6s;
}

.btn-neon:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(67, 97, 238, 0.4);
    background: linear-gradient(135deg, #5dd3f5 0%, #506ef2 100%);
}

.btn-neon:hover::after {
    transform: rotate(45deg) translateY(100%);
}

.btn-neon:active {
    transform: translateY(0);
    box-shadow: 0 4px 12px rgba(67, 97, 238, 0.3);
}

.btn-secondary {
    padding: 8px 16px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.1);
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 600;
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-secondary:hover {
    background: rgba(255,255,255,0.1);
    color: var(--text-main);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

/* =========================================
   RESULTS
   ========================================= */
.results {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    animation: fadeIn 0.5s ease-out;
}

.result-card {
    background: rgba(14, 12, 22, 0.5);
    border-radius: var(--radius-lg);
    padding: 2rem;
    border: 1px solid rgba(255,255,255,0.04);
    transition: all var(--transition-bounce);
    position: relative;
    overflow: hidden;
    min-width: 0;
}

.result-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--accent-gradient);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.result-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
    border-color: rgba(255,255,255,0.08);
}

.result-card:hover::before {
    opacity: 1;
}

.result-card h4 {
    margin-bottom: 1.5rem;
    color: #fff;
    font-size: 1.15rem;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
}

.copy-box {
    background: rgba(5, 5, 12, 0.6);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    color: #b8c4d4;
    margin-bottom: 1.5rem;
    line-height: 1.7;
    border: 1px solid rgba(255, 255, 255, 0.04);
    box-shadow: inset 0 2px 10px rgba(0,0,0,0.3);
    position: relative;
    max-height: 400px;
    overflow-y: auto;
}

.copy-box p {
    margin-bottom: 1rem;
}

.copy-box p:last-child {
    margin-bottom: 0;
}

.text-neon {
    color: var(--neon-blue);
    font-weight: 600;
    text-shadow: 0 0 6px rgba(76, 201, 240, 0.3);
}

/* =========================================
   LOADER
   ========================================= */
.loader {
    text-align: center;
    padding: 3rem 0;
    animation: pulseOpacity 2s infinite;
}

.spinner {
    width: 44px;
    height: 44px;
    border: 3px solid rgba(255,255,255,0.04);
    border-top-color: var(--neon-blue);
    border-radius: 50%;
    animation: spin 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite;
    margin: 0 auto 1.2rem;
    filter: drop-shadow(0 0 8px var(--accent-glow));
}

/* =========================================
   ANIMATIONS
   ========================================= */
@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-15px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.98); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes pulseOpacity {
    0% { opacity: 0.8; }
    50% { opacity: 1; }
    100% { opacity: 0.8; }
}

@keyframes gradient-shift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes subtle-pulse {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

/* =========================================
   SCROLLBAR
   ========================================= */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(76, 201, 240, 0.3);
}

/* =========================================
   SKELETON LOADERS
   ========================================= */
.skeleton {
    background: linear-gradient(90deg, rgba(20,20,30,0.6) 25%, rgba(35,35,50,0.8) 50%, rgba(20,20,30,0.6) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 6px;
}
@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
.skeleton-text { width: 100%; height: 16px; margin-bottom: 12px; }
.skeleton-text.short { width: 60%; }
.skeleton-title { width: 40%; height: 28px; margin-bottom: 20px; }
.skeleton-image { width: 100%; height: 250px; border-radius: 12px; margin-bottom: 15px; }

/* =========================================
   GLOW TRACKING (Micro-interactions)
   ========================================= */
.glow-card {
    position: relative;
    overflow: hidden;
}
.glow-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: radial-gradient(600px circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(255, 255, 255, 0.04), transparent 40%);
    opacity: 0;
    transition: opacity var(--transition-fast);
    pointer-events: none;
    z-index: 1;
}
.glow-card:hover::before {
    opacity: 1;
}

/* =========================================
   TOAST
   ========================================= */
#toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 10001;
}

/* =========================================
   COPILOT WIDGET
   ========================================= */
#copilot-widget {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    font-family: 'Inter', sans-serif;
    pointer-events: none;
}

/* =========================================
   CARRUSEL VIP SCROLLBAR
   ========================================= */
.carrusel-scroll-container {
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 171, 0, 0.5) rgba(255, 255, 255, 0.03);
}
.carrusel-scroll-container::-webkit-scrollbar {
    height: 6px;
}
.carrusel-scroll-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 3px;
}
.carrusel-scroll-container::-webkit-scrollbar-thumb {
    background-color: rgba(255, 171, 0, 0.5);
    border-radius: 3px;
}
.carrusel-scroll-container > div {
    scroll-snap-align: start;
    flex-shrink: 0;
}

/* =========================================
   TEASER / PAYWALL
   ========================================= */
.teaser-mode td {
    filter: blur(5px);
    pointer-events: none;
    user-select: none;
    opacity: 0.7;
}

/* Fix select options contrast */
select option {
    background-color: #0b0f19;
    color: #ffffff;
}

/* =========================================
   SIDEBAR ACCORDION / DROPDOWN
   ========================================= */
.nav-group {
    margin-bottom: 0.25rem;
}

.nav-group summary {
    list-style: none !important;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    user-select: none;
    border-left: 2px solid transparent;
}
.nav-group summary::marker, .mobile-result-accordion summary::marker {
    display: none !important;
    content: "";
}
.nav-group summary::-webkit-details-marker, .mobile-result-accordion summary::-webkit-details-marker {
    display: none !important;
}

.mobile-result-accordion[open] summary i {
    transform: rotate(180deg);
    transition: transform 0.3s ease;
}

.nav-group summary:hover {
    background: rgba(255,255,255,0.03);
    border-left-color: rgba(255,255,255,0.15);
}

.nav-group[open] summary {
    background: linear-gradient(90deg, rgba(76, 201, 240, 0.06), transparent);
    border-left-color: var(--neon-blue);
}

.nav-group-title {
    font-size: 0.72rem;
    font-weight: 800;
    color: #6b7a90;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    transition: color var(--transition-fast);
}

.nav-group[open] .nav-group-title {
    color: var(--neon-blue);
    text-shadow: 0 0 8px rgba(76, 201, 240, 0.3);
}

.nav-chevron {
    font-size: 0.65rem;
    color: var(--text-muted);
    transition: transform var(--transition-fast);
}
.nav-group[open] .nav-chevron {
    transform: rotate(180deg);
    color: var(--neon-blue);
}

.nav-group-content {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    padding-left: 0.5rem;
    margin-top: 0.4rem;
    border-left: 1px solid rgba(255,255,255,0.06);
    margin-left: 0.5rem;
    margin-bottom: 0.5rem;
}

.badge {
    font-size: 0.5rem;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: auto;
    font-weight: 800;
    letter-spacing: 0.5px;
}

/* =========================================
   PREMIUM LOCK
   ========================================= */
.premium-option-locked {
    position: relative;
    opacity: 0.6;
    pointer-events: none;
    transition: all var(--transition-fast);
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(12, 12, 18, 0.8);
    backdrop-filter: blur(10px);
}

.premium-option-locked::after {
    content: '🔒 Requiere Billetera Premium';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(90deg, #4cc9f0, #b5179e);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: bold;
    font-size: 0.85rem;
    z-index: 10;
}

.premium-option-unlocked {
    opacity: 1;
    pointer-events: auto;
    border: 1px solid rgba(76, 201, 240, 0.2);
    box-shadow: 0 0 12px rgba(76, 201, 240, 0.1);
}

/* =========================================
   RESPONSIVE — TABLET
   ========================================= */
@media (max-width: 1024px) {
    .content-grid {
        grid-template-columns: 1fr;
    }
}

/* =========================================
   RESPONSIVE — MOBILE
   ========================================= */
@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
    }
    
    .mobile-only-btn {
        display: block !important;
    }
    
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: 300px;
        height: 100vh;
        z-index: 1000;
        transform: translateX(-100%);
        transition: transform var(--transition-bounce);
        border-right: 1px solid var(--glass-border);
        box-shadow: 10px 0 30px rgba(0, 0, 0, 0.5);
    }
    
    .sidebar.sidebar-active {
        transform: translateX(0);
    }
    
    .main-content {
        padding: 1.2rem 1rem;
    }
    
    .top-header {
        margin-bottom: 1rem;
    }
    
    .top-header h1 {
        font-size: 1.5rem;
    }
    
    .top-header p {
        font-size: 0.85rem;
    }
    
    .glass-panel {
        padding: 1.2rem;
        border-radius: var(--radius-lg);
    }
    
    .glass-panel h3 {
        font-size: 1.1rem;
    }
    
    .carrusel-scroll-container {
        padding-bottom: 10px;
    }
    
    input[type="text"], input[type="password"], input[type="email"], textarea, select {
        font-size: 16px !important;
    }
    
    .sticky-mobile-btn {
        position: sticky;
        bottom: 20px;
        z-index: 90;
        margin-top: 1.5rem !important;
        box-shadow: 0 12px 30px rgba(0,0,0,0.8), 0 0 15px rgba(76, 201, 240, 0.3) !important;
    }
    
    #toast-container {
        right: 10px;
        left: 10px;
        bottom: 80px;
        align-items: stretch;
    }
    
    #inputs-wrapper {
        grid-template-columns: 1fr;
        gap: 1.2rem;
    }

    #copilot-widget {
        bottom: 15px !important;
        right: 15px !important;
        transform: scale(0.85);
        transform-origin: bottom right;
    }
}
