/* --- CAPITAL CASH LINE PREMIUM DARK THEME --- */
@import url("https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap");

/* Custom Scrollbar Global */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: #0B0E14;
}
::-webkit-scrollbar-thumb {
    background: #2D3748;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #39ff14; /* Neon Green */
    box-shadow: 0 0 10px rgba(57, 255, 20, 0.5);
}

:root {
    --bg-body: #0B0E14;       /* Deep Dark Background */
    --bg-card: #151A23;       /* Dark Card */
    --bg-sidebar: #0B0E14;    /* Dark Sidebar */
    
    --text-primary: #F3F4F6;  /* White/Light Gray */
    --text-secondary: #9CA3AF;/* Muted Gray */
    --text-light: #6B7280;    /* Darker Gray */
    
    --color-green: #00F260;   /* Neon Green */
    --color-red: #FF3B30;     /* Neon Red */
    --color-blue: #0575E6;    /* Neon Blue */
    
    --sidebar-width: 260px;
    --border-color: #2D3748; /* Dark Border */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.5);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.5), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
    --neon-glow: 0 0 10px rgba(0, 242, 96, 0.3);
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-primary);
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

a { text-decoration: none; color: inherit; transition: 0.2s; }
ul { list-style: none; padding: 0; margin: 0; }

/* --- SIDEBAR --- */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    padding: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease-in-out;
}

.sidebar-brand {
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    justify-content: center; /* Centered Logo */
    padding: 0 10px;
}

.sidebar-logo {
    max-height: 50px; /* Increased size for visibility */
    width: auto;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    filter: drop-shadow(0 0 5px rgba(0, 242, 96, 0.3)); /* Subtle glow */
}

/* Mobile Logo */
.mobile-logo {
    max-height: 40px;
    width: auto;
    filter: drop-shadow(0 0 5px rgba(0, 242, 96, 0.3));
}

.nav-item {
    margin-bottom: 8px;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-radius: 12px;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); /* Smooth Float */
}

.nav-link i {
    margin-right: 12px;
    width: 20px;
    text-align: center;
    font-size: 1.1rem;
    color: var(--color-red); /* Red Icons */
    transition: transform 0.3s ease;
}

/* Wrapper div inside nav-link (if exists) needs to respect flex */
.nav-link > div {
    display: flex;
    align-items: center;
    width: 100%;
}

.nav-link:hover {
    background-color: rgba(57, 255, 20, 0.05);
    color: var(--text-primary);
    transform: translateX(5px) scale(1.02); /* Float Effect */
    box-shadow: 0 0 15px rgba(57, 255, 20, 0.3); /* Neon Green Glow */
    border: 1px solid rgba(57, 255, 20, 0.3);
}

.nav-link:hover i {
    transform: scale(1.1);
    text-shadow: 0 0 5px rgba(255, 59, 48, 0.5); /* Red Glow for Icon */
}

.nav-link.active {
    background: linear-gradient(90deg, rgba(0, 242, 96, 0.1) 0%, rgba(0, 242, 96, 0.02) 100%);
    color: var(--color-green);
    font-weight: 600;
    border: 1px solid rgba(0, 242, 96, 0.2);
    box-shadow: 0 4px 15px rgba(0, 242, 96, 0.1);
}

.nav-link.active .arrow-icon {
    opacity: 1;
    transform: translateX(0);
}

.nav-link.admin-link {
    color: var(--color-red);
}
.nav-link.admin-link:hover {
    background-color: rgba(239, 68, 68, 0.1);
    color: #ff6b6b;
    text-shadow: 0 0 5px rgba(239, 68, 68, 0.5);
}

/* Sidebar Footer (User Profile) */
.sidebar-footer {
    margin-top: auto;
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border-radius: 12px;
    cursor: pointer;
    transition: 0.2s;
}
.user-profile:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.user-avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #0575E6 0%, #021B79 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    box-shadow: 0 0 10px rgba(5, 117, 230, 0.4);
}

/* --- MAIN CONTENT WRAPPER --- */
.main-content {
    margin-left: var(--sidebar-width);
    padding: 30px;
    min-height: 100vh;
    transition: margin-left 0.3s ease-in-out;
}

.main-content.expanded {
    margin-left: 80px;
}

/* --- CARDS & UI --- */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 24px;
}

.card:hover {
    box-shadow: var(--shadow-md);
    border-color: rgba(255, 255, 255, 0.1);
}

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--border-color);
    padding: 20px 24px;
    font-weight: 600;
    color: var(--text-primary);
}

.card-body {
    padding: 24px;
}

/* --- BUTTONS --- */
.btn {
    border-radius: 10px;
    padding: 10px 20px;
    font-weight: 500;
    text-transform: none; /* No uppercase */
    letter-spacing: normal;
    box-shadow: none !important;
}

.btn-primary {
    background: linear-gradient(135deg, #00F260 0%, #0575E6 100%);
    border: none;
    color: #fff;
}
.btn-primary:hover {
    background: linear-gradient(135deg, #00db56 0%, #0466c8 100%);
    box-shadow: 0 0 15px rgba(0, 242, 96, 0.4);
}

.btn-outline-primary {
    background: transparent;
    color: var(--color-green);
    border: 1px solid var(--color-green);
}
.btn-outline-primary:hover {
    background-color: var(--color-green);
    color: #000;
    box-shadow: 0 0 10px rgba(0, 242, 96, 0.4);
}

.btn-danger {
    background-color: var(--color-red);
    border-color: var(--color-red);
}

/* --- FORMS --- */
.form-control {
    background-color: #1F2937;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 10px;
    padding: 12px;
}
.form-control:focus {
    background-color: #1F2937;
    border-color: var(--color-green);
    color: var(--text-primary);
    box-shadow: 0 0 0 3px rgba(0, 242, 96, 0.1);
}
.form-control::placeholder {
    color: var(--text-light);
}

/* --- RESPONSIVE --- */
@media (max-width: 991px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.active {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
    }
}

/* --- UTILS --- */
/* Analysis Content Styles */
#analysis-blocks .card-body strong {
    color: var(--color-green);
    font-weight: 600;
}
#analysis-blocks .card-body ul, #analysis-blocks .card-body ol {
    margin-left: 20px;
    margin-bottom: 10px;
}
#analysis-blocks .card-body li {
    margin-bottom: 5px;
}

.text-green { color: var(--color-green) !important; text-shadow: 0 0 5px rgba(0, 242, 96, 0.3); }
.text-red { color: var(--color-red) !important; text-shadow: 0 0 5px rgba(255, 59, 48, 0.3); }
.bg-green-soft { background-color: rgba(0, 242, 96, 0.1); color: var(--color-green); padding: 4px 10px; border-radius: 20px; font-size: 0.85rem; border: 1px solid rgba(0, 242, 96, 0.2); }

/* Animation */
.fade-in { animation: fadeIn 0.4s ease-out; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* --- COLLAPSED SIDEBAR --- */
.sidebar.collapsed {
    width: 80px;
}

.sidebar.collapsed .sidebar-brand {
    margin-bottom: 20px;
    padding: 0;
    justify-content: center;
}

/* Sidebar kichraytirilganda logo moslashuvi */
.sidebar.collapsed .sidebar-logo {
    max-height: 35px;
    max-width: 100%;
    object-fit: contain;
}

.sidebar.collapsed .nav-link {
    justify-content: center;
    padding: 12px 0;
}

/* Sidebar kichraytirilganda ikonka markazlashuvi */
.sidebar.collapsed .nav-link > div {
    justify-content: center;
}

.sidebar.collapsed .nav-link span {
    display: none;
}

.sidebar.collapsed .nav-link i {
    margin-right: 0;
    font-size: 1.25rem;
}

.sidebar-toggle-bottom {
    margin-top: auto;
    width: 100%;
    padding: 15px 0;
    background: transparent;
    border: none;
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
    transition: all 0.3s ease;
}

.sidebar-toggle-bottom:hover {
    color: var(--color-green);
    background: rgba(255, 255, 255, 0.02);
}

.sidebar-toggle-bottom i {
    font-size: 1.2rem;
    transition: transform 0.3s ease-in-out;
}

.sidebar.collapsed .sidebar-toggle-bottom i {
    transform: rotate(180deg); /* Rotate Arrow */
}

.sidebar.collapsed .sidebar-footer .d-flex.justify-content-center.gap-3,
.sidebar.collapsed .sidebar-footer .d-flex.align-items-center.justify-content-between {
    display: none !important;
}

.sidebar.collapsed .user-profile {
    justify-content: center;
    padding: 10px 0;
}

.sidebar.collapsed .user-profile .d-flex,
.sidebar.collapsed .user-profile i.fa-chevron-down {
    display: none !important;
}

/* --- CHAT WIDGET --- */
.chat-widget-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #00F260 0%, #0575E6 100%);
    box-shadow: 0 4px 15px rgba(5, 117, 230, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1050;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: none;
    color: white;
    font-size: 24px;
}

.chat-widget-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(0, 242, 96, 0.6);
}

.chat-widget-window {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 380px;
    height: 600px;
    max-height: 80vh;
    background: #1A1D26; /* Dark Chat Window */
    border-radius: 24px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    z-index: 1050;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.1);
    transform-origin: bottom right;
    transform: scale(0);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    pointer-events: none;
}

.chat-widget-window.active {
    transform: scale(1);
    opacity: 1;
    pointer-events: all;
}

.chat-header {
    background: linear-gradient(135deg, #00F260 0%, #0575E6 100%);
    padding: 20px;
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chat-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background-color: #111827; /* Darker chat body */
    scroll-behavior: smooth;
}

.chat-footer {
    padding: 15px;
    background: #1A1D26;
    border-top: 1px solid #2D3748;
}

.chat-input {
    background: #2D3748;
    border: 1px solid #4B5563;
    border-radius: 25px;
    padding: 12px 20px;
    width: 100%;
    outline: none;
    transition: border-color 0.2s;
    color: white;
}

.chat-input:focus {
    border-color: #0575E6;
}

/* Typing Indicator */
.typing-dot {
    width: 6px;
    height: 6px;
    background: #0575E6;
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out both;
    margin: 0 2px;
}
.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes typing {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* Dropdown Menu Dark */
.dropdown-menu {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
}
.dropdown-item {
    color: var(--text-primary);
}
.dropdown-item:hover {
    background-color: rgba(255,255,255,0.1);
    color: var(--text-primary);
}
.dropdown-divider {
    border-top-color: var(--border-color);
}

/* --- UPLOAD ZONE IMPROVEMENTS --- */
#drop-zone {
    background: rgba(255, 255, 255, 0.02) !important;
    border: 2px dashed var(--border-color) !important;
    transition: all 0.3s ease;
}

#drop-zone:hover, #drop-zone.drag-active {
    background: rgba(0, 242, 96, 0.05) !important;
    border-color: var(--color-green) !important;
    box-shadow: 0 0 20px rgba(0, 242, 96, 0.1);
}

#drop-zone i {
    color: var(--text-secondary);
    transition: all 0.3s ease;
}

#drop-zone:hover i {
    color: var(--color-green);
    transform: scale(1.1);
    text-shadow: 0 0 10px rgba(0, 242, 96, 0.6);
}

/* --- TEXT VISIBILITY ENHANCEMENTS --- */
h1, h2, h3, h4, h5, h6 {
    color: var(--text-primary);
}

.text-muted {
    color: var(--text-secondary) !important;
}

/* Stronger Neon for special text */
.text-neon-green {
    color: var(--color-green);
    text-shadow: 0 0 8px rgba(0, 242, 96, 0.5);
}

/* Analysis Result Special Styling */
.display-3.text-success, .display-3.text-danger {
    text-shadow: 0 0 25px currentColor;
}

/* --- INSTRUMENT CHIPS --- */
.instrument-chip {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.3s ease;
    cursor: pointer;
    text-transform: uppercase;
}

.instrument-chip:hover {
    border-color: var(--color-green);
    color: white;
    box-shadow: 0 0 10px rgba(0, 242, 96, 0.3);
    background: rgba(0, 242, 96, 0.05);
    transform: translateY(-2px);
}

.instrument-chip.active {
    border-color: var(--color-green);
    color: var(--color-green);
    background: rgba(0, 242, 96, 0.15);
    box-shadow: 0 0 15px rgba(0, 242, 96, 0.4);
    font-weight: 700;
}

/* Chip Animation */
@keyframes slideDownFade {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-chip {
    animation: slideDownFade 0.3s ease-out forwards;
    opacity: 0; /* Start hidden */
}

