/* Global styles */
body {
    font-family: Arial, sans-serif !important;
    margin: 0;
    background-color: #f5f6fa !important;
}

/* Tab styling */
.dash-tabs-container {
    margin: 20px !important;
}

.dash-tab {
    padding: 10px 20px !important;
    font-family: Arial, sans-serif !important;
}

.dash-tab--selected {
    border-top: 2px solid #2980b9 !important;
    color: #2980b9 !important;
}

/* Content area styling */
h3 {
    color: #2c3e50 !important;
    margin-bottom: 20px !important;
    font-family: Arial, sans-serif !important;
}

p {
    line-height: 1.6 !important;
    color: #34495e !important;
    font-family: Arial, sans-serif !important;
}

/* Tab content container */
#tab-content {
    padding: 30px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background-color: white;
    margin-top: 20px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

#real-estate-tab-content {
    padding: 25px;
    border-radius: 8px;
    background-color: white;
} 

/* Content Area */
.content {
    max-width: 2600px;
    margin: 0 auto;
    padding: 10px 20px;
    box-sizing: border-box;
}

@media (max-width: 768px) {
    .content {
        padding: 10px;  /* Reduced padding on mobile */
    }
}

/* Mobile stats grid - keep numbers visible by enabling horizontal scroll */
@media (max-width: 768px) {
    /* Target container */
    div[id$="-stats-grid"] {
        overflow-x: auto !important;
        border-left: none !important;
        border-right: none !important;
        margin: 0 -10px !important;
        padding: 0 10px !important;
        width: calc(100% + 20px) !important;
    }
}

/* Main tabs styling (Real Estate, Stock Market, Crypto) */
#tabs .tab {
    background-color: #ffffff !important;
    border-radius: 8px 8px 0 0 !important;
    border: none !important;
    padding: 16px 32px !important;
    font-family: "Inter", "Segoe UI", Arial, sans-serif;
    font-size: 16px;
    font-weight: 500;
    color: #64748b;
    margin-right: 4px;
    transition: all 0.2s ease;
    box-shadow: 0 -2px 4px rgba(0,0,0,0.02);
}

#tabs .tab--selected {
    background-color: #1a365d !important;
    color: white !important;
    font-weight: 600;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

#tabs .tab:hover {
    background-color: #f1f5f9 !important;
    color: #1a365d !important;
}

#tabs .tab--selected:hover {
    background-color: #1a365d !important;
    color: white !important;
}

/* Subtabs navbar styling */
.sub-navbar {
    width: 100%;
    margin-top: 20px;
    background-color: #f8fafc;
    padding: 10px 10px 0 10px;
    border-radius: 12px;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
    position: relative;
}

.sub-navbar::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

/* Dots indicator container */
.sub-navbar-dots {
    display: none; /* Hidden by default, shown on mobile */
    justify-content: center;
    gap: 6px;
    margin-top: 8px;
    padding-bottom: 8px;
}

.sub-navbar-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: #cbd5e1;
    transition: all 0.3s ease;
}

.sub-navbar-dot.active {
    background-color: #3b82f6;
    transform: scale(1.2);
}

.sub-nav-link {
    background-color: transparent !important;
    border: 2px solid transparent !important;
    border-radius: 20px !important;
    padding: 8px 20px !important;
    font-size: 14px;
    font-weight: 500;
    color: #64748b;
    transition: all 0.2s ease;
    text-decoration: none !important;
    white-space: nowrap;
    flex-shrink: 0;
}

.sub-nav-link:hover {
    background-color: rgba(255,255,255,0.8) !important;
    color: #3b82f6 !important;
}

.sub-nav-link.active {
    background-color: white !important;
    border: 2px solid #e2e8f0 !important;
    color: #3b82f6 !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* Mobile Responsive Styles for Sub-navbar */
@media (max-width: 768px) {
    .sub-navbar {
        margin-top: 15px;
        padding: 8px 8px 0 8px;
        border-radius: 8px;
        gap: 6px;
    }

    .sub-navbar-dots {
        display: flex; /* Show dots on mobile */
    }

    .sub-nav-link {
        padding: 6px 16px !important;
        font-size: 13px;
        border-radius: 16px !important;
    }
}

/* Time Range Selector Styling */
.custom-radio-items {
    display: flex;
    gap: 12px;
    background-color: #f8fafc;
    padding: 4px;
    border-radius: 10px;
}

.custom-radio-label {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #64748b;
    transition: all 0.2s ease;
}

.custom-radio-input {
    display: none;
}

.custom-radio-input:checked + .custom-radio-label {
    background-color: #3b82f6;
    color: white;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.2);
}

.custom-radio-label:hover:not(:has(+ .custom-radio-input:checked)) {
    background-color: #e2e8f0;
    color: #1e293b;
}

/* Date Range Picker Button Hover */
#custom-range-button:hover {
    background-color: #f8fafc;
    border-color: #cbd5e1;
}

/* Date Range Picker Container */
.DateRangePicker {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Date Range Picker Input */
.DateInput_input {
    font-size: 14px;
    padding: 8px 12px;
    border-radius: 6px;
}

.DateInput_input__focused {
    border-color: #3b82f6;
}

/* Page header styling */
.page-header {
    background-color: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-title {
    color: #1a365d !important;
    margin: 0 !important;
    padding: 15px 0 !important;
    font-family: 'Arial', sans-serif !important;
    font-size: 1.8rem !important;
    font-weight: 600 !important;
}

/* Mobile menu button */
.mobile-menu-button {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
}

.mobile-menu-button span {
    width: 100%;
    height: 3px;
    background-color: #1a365d;
    border-radius: 3px;
    transition: all 0.3s ease;
}

.main-navbar {
    display: flex !important;
    justify-content: flex-start !important;
    gap: 4px;
    padding: 0 0 10px 0 !important;
}

/* Replace tabs styling with navbar styling */
.main-navbar .nav-link {
    background-color: transparent !important;
    border: none !important;
    padding: 8px 16px !important;
    font-family: "Inter", "Segoe UI", Arial, sans-serif;
    font-size: 15px;
    font-weight: 500;
    color: #64748b;
    transition: all 0.2s ease;
    text-decoration: none !important;
    white-space: nowrap;
    border-radius: 6px;
}

.main-navbar .nav-link:hover {
    background-color: #f1f5f9 !important;
    color: #1a365d !important;
}

.main-navbar .nav-link.active {
    background-color: #1a365d !important;
    color: white !important;
    font-weight: 600;
}

.main-navbar .nav-link.active:hover {
    background-color: #1a365d !important;
    color: white !important;
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
    .header-container {
        padding: 0 15px;
    }

    .header-title {
        font-size: 1.5rem !important;
        padding: 12px 0 !important;
    }

    .mobile-menu-button {
        display: flex;
    }

    .main-navbar {
        display: none !important;
        flex-direction: column !important;
        position: absolute !important;
        top: 100% !important;
        left: 0 !important;
        right: 0 !important;
        background-color: white !important;
        padding: 10px 15px !important;
        box-shadow: 0 4px 6px rgba(0,0,0,0.1) !important;
        gap: 8px !important;
    }

    .main-navbar.active {
        display: flex !important;
    }

    .main-navbar .nav-link {
        padding: 12px 16px !important;
        font-size: 16px !important;
        width: 100% !important;
        text-align: left !important;
    }

    /* Hamburger menu animation */
    .mobile-menu-button.active span:nth-child(1) {
        transform: translateY(9px) rotate(45deg);
    }

    .mobile-menu-button.active span:nth-child(2) {
        opacity: 0;
    }

    .mobile-menu-button.active span:nth-child(3) {
        transform: translateY(-9px) rotate(-45deg);
    }
}

/* Responsive Filters */
.filter-section {
    margin: 20px 0;
}

.filter-container {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05); /* Soft shadow */
    border: 1px solid #eef2f7;
    margin-bottom: 20px;
    
    /* This aligns the internal rows */
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.filter-row {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap; /* Allows wrapping on mobile */
    gap: 15px; /* Space between dropdowns */
    align-items: flex-end; /* Aligns dropdowns to the bottom so labels don't mess up alignment */
}

.filter-item {
    flex: 1; /* Each item tries to take equal width */
    min-width: 200px; /* But won't get smaller than 200px (triggers wrap on mobile) */
}

.filter-item label, 
.filter-item-wide label {
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 700;
    color: #6c757d;
    margin-bottom: 6px;
    display: block;
    letter-spacing: 0.5px;
}

.filter-item-wide {
    width: 100%;
}

.filter-label-small {
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 700;
    color: #6c757d;
    margin-bottom: 8px;
    display: block;
    letter-spacing: 0.5px;
}

/*
.responsive-dropdown {
    width: 100% !important;
}*/

/*
.multi-dropdown .Select-control {
    min-height: 40px !important;
}*/

.responsive-button {
    background-color: #1e3c72; /* Your brand blue */
    color: white;
    border: none;
    padding: 0 30px;
    height: 38px; /* Standard Dash dropdown height */
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    margin-top: 5px; /* Small adjustment if it sits on its own line */
}

.responsive-button:hover {
    background-color: #2a5298;
}

@media (max-width: 768px) {
    .filter-row {
        flex-direction: column; /* Stack vertically on phones */
        gap: 10px;
    }
    
    .filter-item, 
    .responsive-button {
        width: 100%; /* Full width on mobile */
        min-width: 0;
    }
}

/*
@media (min-width: 769px) and (max-width: 1024px) {
    .filter-item {
        flex: 1 1 45%;
    }
}*/

/* Wrapper to handle mobile scrolling */
.table-scroll-wrapper {
    overflow-x: auto;
    width: 100%;
    margin-bottom: 30px;
}

/* The Table Container */
.dash-table-container {
    background: white;
    border-radius: 8px;
    border: 1px solid #eef2f7;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    min-width: 600px; /* Ensures it doesn't squish on mobile */
    display: flex;
    flex-direction: column;
}

/* Rows (Header and Data) */
.dash-table-row {
    display: grid;
    /* Create 5 equal columns. Change to '2fr 1fr...' if you want custom widths */
    grid-template-columns: repeat(5, 1fr); 
    border-bottom: 1px solid #f1f1f1;
}

/* Header Specifics */
.dash-table-row.header {
    background-color: #f8f9fa;
    border-bottom: 2px solid #eef2f7;
    border-radius: 8px 8px 0 0;
}

.dash-header-cell {
    padding: 15px;
    font-size: 0.75rem;
    font-weight: 700;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center; /* Vertically center */
    /* Justify content based on text-align is handled by the inline style in Python */
}

/* Data Cell Specifics */
.dash-cell {
    padding: 15px;
    font-size: 0.95rem;
    color: #2c3e50;
    font-family: 'Roboto', sans-serif;
    
    /* CRITICAL FOR FINANCE: This makes numbers line up (tabular figures) */
    font-variant-numeric: tabular-nums; 
    
    display: flex;
    align-items: center;
    /* Justify content based on text-align is handled by the inline style in Python */
}

/* Hover Effect for Rows */
.dash-table-row:not(.header):hover {
    background-color: #f8faff;
}

/* 1. Main Toolbar Container (The White Box) */
.time-toolbar-container {
    background: white;
    padding: 15px 20px;
    border-radius: 12px;
    border: 1px solid #eef2f7;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    margin-bottom: 30px;
    
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

/* Grouping for Flex Layout */
.time-left-group, .time-right-group {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* The Label "Vremenski period:" */
.time-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* --- THE SEGMENTED CONTROL (The Gray Track) --- */
.segmented-control {
    background-color: #f1f3f5; /* Light gray track */
    padding: 4px;
    border-radius: 8px;
    display: inline-flex;
    flex-wrap: nowrap;
}

/* Hide the actual Radio Circle Input */
.segmented-input {
    display: none;
}

/* The Buttons (Labels) */
.segmented-label {
    padding: 6px 16px;
    font-size: 0.9rem;
    font-weight: 500;
    color: #6c757d;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s ease;
    margin-right: 0 !important; /* Override Dash default */
    user-select: none;
}

/* Hover State */
.segmented-label:hover {
    color: #333;
    background-color: rgba(255,255,255,0.5);
}

/* ACTIVE STATE: When the hidden input inside is checked */
/* This uses the modern CSS :has selector */
.segmented-label:has(input:checked) {
    background-color: white;
    color: #1e3c72; /* Brand Blue */
    font-weight: 700;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* --- THE "PRILAGODI" BUTTON (Ghost Style) --- */
.ghost-button {
    background: transparent;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 8px 16px;
    color: #64748b;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    height: 38px; /* Match height of segmented control */
}

.ghost-button:hover {
    background-color: #f8fafc;
    border-color: #cbd5e1;
    color: #333;
}

/* Mobile Fixes */
@media (max-width: 768px) {
    .time-toolbar-container {
        flex-direction: column;
        align-items: stretch;
    }
    
    .time-left-group, .time-right-group {
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
    }
    
    .segmented-control {
        width: 100%;
        display: flex;
    }
    
    .segmented-label {
        flex: 1; /* Distribute buttons evenly on phone */
        text-align: center;
        font-size: 0.8rem;
        padding: 8px 4px;
    }
    
    .ghost-button {
        width: 100%;
    }
}

/* --- SCROLLER CONTAINER --- */
.deals-scroller {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    padding: 10px 5px 20px 5px;
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

/* --- DEAL CARD --- */
.deal-card {
    background: white;
    min-width: 280px;
    max-width: 280px;
    border-radius: 12px;
    border: 1px solid #eef2f7;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    padding: 15px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.2s, box-shadow 0.2s;
    flex: 0 0 auto; 
}

.deal-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
    border-color: #cbd5e1;
}

/* --- HEADER --- */
.deal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.deal-date {
    font-size: 0.8rem;
    color: #94a3b8;
}

/* Uniform Status Badge (Neutral Style) */
.status-badge {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 10px;
    text-transform: uppercase;
    max-width: 120px;
    
    /* Neutral Design */
    background: #f1f5f9; 
    color: #475569;
    border: 1px solid #e2e8f0;

    /* Text Truncation */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* --- BODY --- */
.deal-price {
    font-size: 1.3rem;
    font-weight: 700;
    color: #1e3c72;
    line-height: 1.1;
    margin-bottom: 4px;
}

.deal-class {
    font-size: 0.85rem;
    color: #64748b;
    font-weight: 500;
    margin-bottom: 10px;
    
    /* Truncate long classifications */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border-bottom: 1px dashed #e2e8f0; 
    padding-bottom: 8px;
}

/* --- LOCATION --- */
.deal-location {
    font-size: 0.85rem;
    color: #64748b;
    margin-bottom: 15px;
    
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* --- FOOTER --- */
.deal-footer {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    border-top: 1px solid #f1f5f9;
    padding-top: 10px;
    margin-top: auto;
}

.footer-col {
    display: flex;
    flex-direction: column;
}

.footer-col:last-child {
    align-items: flex-end; /* Right align price/m2 */
}

.deal-label {
    font-size: 0.7rem;
    color: #94a3b8;
    text-transform: uppercase;
    margin-bottom: 2px;
}

.deal-value {
    font-size: 0.95rem;
    font-weight: 600;
    color: #334155;
}

.deal-value.highlight {
    color: #1e3c72;
}

/* Stock Market Price Display */
.price-header {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    margin-bottom: 20px;
}

.company-name {
    color: #2c3e50;
    font-family: Arial, sans-serif;
}

.price-change-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.price-value {
    color: #2c3e50;
    font-weight: 600;
}

.price-change {
    font-weight: 600;
}

.price-change.positive {
    color: #27ae60;
}

.price-change.negative {
    color: #c0392b;
}

.price-change-percent {
    font-weight: 500;
}

.price-change-percent.positive {
    color: #27ae60;
}

.price-change-percent.negative {
    color: #c0392b;
}

/* Stock Market Time Period Tabs */
#stock-chart-period-dropdown {
    display: flex;
    gap: 0;
    margin-top: 20px;
    background-color: #f8fafc;
    border-radius: 8px;
    padding: 4px;
    width: fit-content;
}

#stock-chart-period-dropdown .stock-radio-input {
    display: none; /* Hide actual radio buttons */
}

#stock-chart-period-dropdown .stock-radio-label {
    display: block;
    padding: 10px 24px;
    cursor: pointer;
    color: #64748b;
    font-weight: 500;
    transition: all 0.2s ease;
    position: relative;
    border-bottom: 2px solid transparent;
}

#stock-chart-period-dropdown .stock-radio-label:hover {
    color: #3b82f6;
    background-color: rgba(255,255,255,0.8);
}

#stock-chart-period-dropdown .stock-radio-input:checked + .stock-radio-label {
    color: white !important;
    font-weight: 600;
    border-bottom: 2px solid transparent;
}

/* Different colors for each time period */
#stock-chart-period-dropdown .stock-radio-input[value="7d"]:checked + .stock-radio-label {
    background-color: #10B981 !important; /* Emerald green */
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.2);
}

#stock-chart-period-dropdown .stock-radio-input[value="1mo"]:checked + .stock-radio-label {
    background-color: #3B82F6 !important; /* Royal blue */
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.2);
}

#stock-chart-period-dropdown .stock-radio-input[value="1y"]:checked + .stock-radio-label {
    background-color: #F59E0B !important; /* Amber */
    box-shadow: 0 2px 4px rgba(245, 158, 11, 0.2);
}

#stock-chart-period-dropdown .stock-radio-input[value="3y"]:checked + .stock-radio-label {
    background-color: #8B5CF6 !important; /* Violet */
    box-shadow: 0 2px 4px rgba(139, 92, 246, 0.2);
}

#stock-chart-period-dropdown .stock-radio-input[value="5y"]:checked + .stock-radio-label {
    background-color: #EC4899 !important; /* Pink */
    box-shadow: 0 2px 4px rgba(236, 72, 153, 0.2);
}

#stock-chart-period-dropdown .stock-radio-input[value="max"]:checked + .stock-radio-label {
    background-color: #6366F1 !important; /* Indigo */
    box-shadow: 0 2px 4px rgba(99, 102, 241, 0.2);
}

/* Base hover state */
#stock-chart-period-dropdown .stock-radio-label:hover {
    background-color: rgba(59, 130, 246, 0.1) !important;
    color: #1E40AF !important;
}

/* Selected state hover */
#stock-chart-period-dropdown .stock-radio-input:checked + .stock-radio-label:hover {
    opacity: 0.9;
}

/* Transition effects */
#stock-chart-period-dropdown .stock-radio-label {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Metrics Section */
.metrics-container {
    margin: 25px 0;
}

.metric-box {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: transform 0.2s ease;
}

.metric-box:hover {
    transform: translateY(-2px);
}

.metric-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.9em;
}

.metric-item span {
    color: #64748b;
    font-weight: 500;
}

.ownership-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9em;
}

.ownership-table td, .ownership-table th {
    padding: 8px 0;
    border-bottom: 1px solid #f1f5f9;
}

.box-title {
    color: #1e293b;
    font-size: 1.1em;
    border-bottom: 2px solid #3b82f6;
    padding-bottom: 8px;
}

/* Metrics Container */
#metrics-container {
    background-color: #f8fafc;
    padding: 25px;
    border-radius: 12px;
    margin: 30px 0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.metric-box {
    flex: 1 1 30%;
    min-width: 300px;
    margin: 10px;
    padding: 20px;
    border-radius: 8px;
    background: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.financial-basics { background-color: #f0f9ff; }
.financial-metrics { background-color: #f0fdf4; }
.top-holders { background-color: #faf5ff; }

.metric-table {
    width: 100%;
    border-collapse: collapse;
}

.metric-table td {
    padding: 8px 0;
    border-bottom: 1px solid #f1f5f9;
}

.metric-label {
    color: #64748b;
    font-weight: 500;
    width: 60%;
}

.metric-value {
    color: #1e293b;
    text-align: right;
    width: 40%;
}

.table-header {
    color: #475569;
    font-weight: 600;
    padding: 8px 0;
    border-bottom: 2px solid #e2e8f0;
}

/* News article cards with link preview */
.news-article-card {
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    margin-bottom: 15px;
    background-color: #ffffff;
    transition: transform 0.2s, box-shadow 0.2s;
    overflow: hidden;
}

.news-article-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.news-article-header {
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 1px solid #eee;
}

.news-article-title-container {
    flex: 1;
    padding-right: 15px;
}

.news-article-title-link {
    font-size: 16px;
    font-weight: bold;
    color: #2c3e50;
    text-decoration: none;
    display: inline-block;
    margin-bottom: 5px;
}

.news-article-title-link:hover {
    text-decoration: underline;
    color: #3498db;
}

.news-article-date {
    font-size: 12px;
    color: #7f8c8d;
    margin: 0;
    white-space: nowrap;
    min-width: 80px;
    text-align: right;
}

.news-article-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.news-article-link:hover {
    text-decoration: none;
}

.news-preview-container {
    padding: 0;
    background-color: #f9fafb;
    border-bottom: 1px solid #eee;
    transition: background-color 0.2s;
    display: flex;
    min-height: 120px;
}

.news-article-link:hover .news-preview-container {
    background-color: #edf2f7;
}

.news-preview-image {
    width: 150px;
    min-width: 150px;
    height: 120px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: #e2e8f0;
}

.news-preview-content-container {
    flex: 1;
    padding: 15px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.news-preview-description {
    font-size: 14px;
    color: #4b5563;
    line-height: 1.5;
    margin: 0 0 10px 0;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.news-preview-source {
    margin: 5px 0 0 0;
}

.news-source-url {
    font-size: 14px;
    color: #3498db;
    background-color: #e2e8f0;
    padding: 3px 8px;
    border-radius: 4px;
}

.news-article-footer {
    padding: 10px 15px;
    background-color: #ffffff;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.news-relevance {
    font-size: 12px;
    color: #7f8c8d;
    background-color: #f1f1f1;
    padding: 2px 6px;
    border-radius: 10px;
}

.news-sentiment {
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 10px;
}

.news-sentiment.sentiment-positive {
    background-color: rgba(46, 204, 113, 0.2);
    color: #27ae60;
}

.news-sentiment.sentiment-negative {
    background-color: rgba(231, 76, 60, 0.2);
    color: #c0392b;
}

.news-sentiment.sentiment-neutral {
    background-color: rgba(52, 152, 219, 0.2);
    color: #2980b9;
}

/* When no image is available */
.news-preview-container:not(:has(.news-preview-image)) .news-preview-content-container {
    width: 100%;
}

/* No data message */
.no-data-message {
    padding: 20px;
    color: #7f8c8d;
    text-align: center;
    font-style: italic;
}

/* Error message */
.error-message {
    padding: 20px;
    color: #c0392b;
    text-align: center;
    font-style: italic;
    background-color: rgba(231, 76, 60, 0.1);
    border-radius: 5px;
}

/* Pagination controls */
.pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 15px;
    padding: 10px;
}

.pagination-button {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
}

.pagination-button:hover:not([disabled]) {
    background-color: #2980b9;
}

.pagination-button:disabled {
    background-color: #bdc3c7;
    cursor: not-allowed;
}

.pagination-info {
    margin: 0 15px;
    font-size: 14px;
    color: #7f8c8d;
}

/* News articles container */
.news-articles-container {
    max-height: 600px;
    overflow-y: auto;
}

/* Time range selector responsive styling */
.time-range-container {
    display: flex;
    flex-direction: column;
}

.time-range-selector-top {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.time-range-label {
    margin-right: 15px;
}

.custom-radio-items {
    margin-right: 20px;
}

.time-range-selector-bottom {
    display: flex;
    align-items: center;
}

/* Desktop view */
@media (min-width: 769px) {
    .time-range-container {
        flex-direction: row;
        align-items: center;
    }
    
    .time-range-selector-top {
        margin-bottom: 0;
        margin-right: 20px;
    }
}

/* Mobile view specific time range adjustments */
@media (max-width: 768px) {
    .time-range-selector-top {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .time-range-selector-top label {
        display: block;
        margin-bottom: 10px;
        margin-right: 0 !important;
    }
    
    .custom-radio-items {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        width: 100%;
    }
    
    .time-range-selector-bottom {
        flex-wrap: wrap;
    }
    
    .time-range-selector-bottom button {
        margin-top: 10px;
        width: 100%;
    }
    
    .DateRangePicker {
        width: 100%;
    }
    
    .DateRangePickerInput {
        width: 100%;
    }
    
    .DateInput {
        width: 50%;
    }
}

/* --- MAP TOOLBAR CONTAINER --- */
.map-toolbar-container {
    background: white;
    padding: 15px 20px;
    border-radius: 12px 12px 0 0; /* Rounded top only (Map attaches to bottom) */
    border: 1px solid #eef2f7;
    border-bottom: none; /* Map graph below will provide the bottom border */
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

/* Title Styling */
.map-toolbar-title {
    font-size: 1.1em;
    font-weight: 700;
    color: #34495e;
    margin: 0;
}

/* Right Side Controls Group */
.map-controls-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Vertical Divider Line */
.vertical-divider {
    width: 1px;
    height: 24px;
    background-color: #e2e8f0;
}

/* --- DROPDOWN STYLING --- */
/* Wrapper to force width */
.year-select-wrapper {
    width: 140px;
}

/* Customizing the Dash Dropdown to look cleaner */
.map-year-dropdown .Select-control {
    border: 1px solid #e2e8f0 !important;
    border-radius: 8px !important;
    height: 36px !important;
    background-color: #f8f9fa !important;
    font-size: 0.9rem !important;
}

.map-year-dropdown .Select-menu-outer {
    border-radius: 8px !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1) !important;
    margin-top: 5px !important;
}

/* Hover effect on dropdown */
.map-year-dropdown .Select-control:hover {
    border-color: #cbd5e1 !important;
    background-color: white !important;
}

/* --- MAP CONTAINER TWEAKS --- */
/* Remove top border radius from graph container since toolbar handles it */
.map-container {
    border-top-left-radius: 0 !important;
    border-top-right-radius: 0 !important;
    border-top: none !important;
}

/* MOBILE FIX */
@media (max-width: 768px) {
    .map-toolbar-container {
        flex-direction: column;
        align-items: stretch;
    }

    .map-controls-right {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
    }

    .vertical-divider {
        display: none; /* Hide divider on mobile */
    }

    .year-select-wrapper {
        width: 100%;
    }
    
    /* Make segmented control full width */
    .segmented-control {
        display: flex;
        width: 100%;
    }
    
    .segmented-label {
        flex: 1;
        text-align: center;
    }
}


/* Graph containers - make scrollable on mobile */
.graph-container {
    width: 100%;
    margin-bottom: 20px;
}

@media (max-width: 768px) {
    .graph-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Ensure graphs have a minimum width to prevent squishing */
    .graph-container .js-plotly-plot,
    .graph-container .plotly,
    .graph-container .plot-container {
        min-width: 600px;
    }
}

/* Mobile scrollable containers for stock market page */
@media (max-width: 768px) {
    .price-header-container,
    .turnover-container-wrapper,
    .btc-chart-wrapper {
        -webkit-overflow-scrolling: touch;
        position: relative;
    }
}

/* Set CSS variable for page padding */
:root {
    --page-padding: 20px;
}

@media (max-width: 768px) {
    :root {
        --page-padding: 10px;
    }
}

/* TradingView Ticker Tape - Mobile view */
@media (max-width: 768px) {
    .ticker-tape-container {
        margin-left: -10px !important;
        margin-right: -10px !important;
        width: calc(100% + 20px) !important;
        height: 60px !important;
    }
    
    /* Change the iframe source directly for mobile */
    .ticker-tape-container iframe {
        transform: scale(0.7);
        transform-origin: left top;
        width: 143% !important;
        height: 90px !important;
    }
}

/* Full width container that breaks out of parent padding */
.full-width-break-out {
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    margin-bottom: 20px;
}

/* Custom scrollbar for BTC chart */
.btc-chart-wrapper {
    /* Always show scrollbar even when not needed */
    overflow-x: scroll !important;
    scrollbar-width: thin !important; /* Firefox */
    scrollbar-color: #3b82f6 #e2e8f0 !important; /* Firefox: thumb and track color */
}

/* Webkit browsers scrollbar styling (Chrome, Safari, newer Edge) */
.btc-chart-wrapper::-webkit-scrollbar {
    height: 10px !important;
    width: 10px !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.btc-chart-wrapper::-webkit-scrollbar-track {
    background: #e2e8f0 !important;
    border-radius: 4px !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.btc-chart-wrapper::-webkit-scrollbar-thumb {
    background: #3b82f6 !important;
    border-radius: 4px !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.btc-chart-wrapper::-webkit-scrollbar-thumb:hover {
    background: #2563eb !important;
}

/* Force always visible even when idle */
.btc-chart-wrapper::-webkit-scrollbar-thumb:vertical,
.btc-chart-wrapper::-webkit-scrollbar-thumb:horizontal {
    min-height: 30px !important;
    min-width: 30px !important;
}

/* Make scrollbar more visible on mobile */
@media (max-width: 768px) {
    .btc-chart-wrapper::-webkit-scrollbar {
        height: 12px !important;
    }
    
    .btc-chart-wrapper::-webkit-scrollbar-thumb {
        background: #ef4444 !important; /* Red color for even more visibility on mobile */
    }
    
    .btc-chart-wrapper::-webkit-scrollbar-thumb:hover {
        background: #dc2626 !important;
    }
}

/* Mobile scrollable containers for stock market page */
@media (max-width: 768px) {
    .price-header-container,
    .turnover-container-wrapper,
    .btc-chart-wrapper {
        -webkit-overflow-scrolling: touch;
        position: relative;
    }
}

/* Scroll arrow animation */
@keyframes pulse {
    0% {
        transform: translateY(50%) scale(1);
        opacity: 0.8;
    }
    50% {
        transform: translateY(50%) scale(1.2);
        opacity: 1;
    }
    100% {
        transform: translateY(50%) scale(1);
        opacity: 0.8;
    }
}

.scroll-arrow-indicator {
    animation: pulse 2s infinite ease-in-out;
}

/* Make arrow indicator visible only on mobile devices */
@media (min-width: 769px) {
    .scroll-arrow-indicator {
        display: none !important;
    }
}

/* Loading placeholder for lazy-loaded charts */
.loading-placeholder {
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    color: #64748b;
}

/* Footer */
.site-footer {
    background-color: #0f172a; /* deep slate */
    color: #e2e8f0;
    margin-top: 30px;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 20px 30px 20px;
}

.footer-top {
    display: grid;
    grid-template-columns: 1.2fr 1fr 1fr;
    gap: 24px;
    align-items: start;
    border-bottom: 1px solid rgba(226, 232, 240, 0.15);
    padding-bottom: 16px;
}

.footer-title {
    margin: 0 0 6px 0 !important;
    color: #f8fafc !important;
    font-size: 1.2rem !important;
    font-weight: 600 !important;
}

.footer-tagline {
    margin: 0;
    color: #94a3b8;
}

.footer-heading {
    margin: 0 0 8px 0;
    color: #cbd5e1;
    font-size: 0.95rem;
    font-weight: 600;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-link {
    color: #cbd5e1;
    text-decoration: none;
    display: inline-block;
    padding: 4px 0;
    transition: color 0.2s ease;
}

.footer-link:hover {
    color: #60a5fa;
    text-decoration: underline;
}

.footer-bottom {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-top: 16px;
}

.footer-copy {
    margin: 0;
    color: #94a3b8;
}

.footer-disclaimer {
    margin: 0;
    color: #64748b;
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    .footer-top {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .footer-container {
        padding: 20px 15px 24px 15px;
    }
}

/* SEO Content Section - Visible to search engines */
.seo-content-section {
        background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%); /* Deep Blue Gradient */
        color: white;
        padding: 40px 20px !important;
        border-radius: 12px;
        box-shadow: 0 10px 25px rgba(30, 60, 114, 0.15);
        margin-bottom: 30px;
        text-align: center;
}

.location-header h1 {
        font-weight: 700;
        margin-bottom: 15px;
        font-size: 2.2rem;
        color: white !important;
}

.seo-main-heading {
    color: #1a365d !important;
    font-size: 2rem !important;
    font-weight: 700 !important;
    margin: 0 0 20px 0 !important;
    font-family: Arial, sans-serif !important;
    line-height: 1.3 !important;
}

.seo-intro {
        color: white !important; /* Off-white for readability */
        font-size: 1.1rem;
        margin: 0 auto;
}

.seo-subheading {
    color: #2c3e50 !important;
    font-size: 1.4rem !important;
    font-weight: 600 !important;
    margin: 30px 0 15px 0 !important;
    font-family: Arial, sans-serif !important;
    line-height: 1.4 !important;
}

.seo-description {
    font-size: 1rem !important;
    line-height: 1.7 !important;
    color: #34495e !important;
    margin: 0 0 20px 0 !important;
    font-family: Arial, sans-serif !important;
}

.seo-feature-list {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 0 25px 0 !important;
}

.seo-feature-list li {
    padding: 12px 0 12px 30px !important;
    position: relative !important;
    font-size: 1rem !important;
    line-height: 1.6 !important;
    color: #34495e !important;
    font-family: Arial, sans-serif !important;
    border-bottom: 1px solid #e2e8f0 !important;
}

.seo-feature-list li:last-child {
    border-bottom: none !important;
}

.seo-feature-list li::before {
    content: "✓" !important;
    position: absolute !important;
    left: 0 !important;
    color: #2980b9 !important;
    font-weight: bold !important;
    font-size: 1.2rem !important;
}

.seo-feature-list li strong {
    color: #2c3e50 !important;
    font-weight: 600 !important;
}

@media (max-width: 768px) {
    .seo-content-section {
        padding: 20px 15px;
        margin: 15px 0;
    }

    .seo-main-heading {
        font-size: 1.6rem !important;
        margin-bottom: 15px !important;
    }

    .seo-intro {
        font-size: 1rem !important;
        margin-bottom: 20px !important;
    }

    .seo-subheading {
        font-size: 1.2rem !important;
        margin: 25px 0 12px 0 !important;
    }

    .seo-description {
        font-size: 0.95rem !important;
    }

    .seo-feature-list li {
        font-size: 0.95rem !important;
        padding: 10px 0 10px 25px !important;
    }
}

/* Container for the cards */
.sumstats-grid {
    display: grid;
    /* This creates a responsive grid: minimum card width 250px, otherwise fill space */
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); 
    gap: 20px;
    margin-bottom: 30px;
}

/* Individual Card Styling */
.sumstat-card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    /* Light shadow for depth */
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05); 
    border: 1px solid #eef2f7;
    /* Left accent border (Blue) to match your brand */
    border-left: 5px solid #1e3c72; 
    display: flex;
    flex-direction: column;
    justify-content: center;
    transition: transform 0.2s ease;
}

/* Hover effect (optional) */
.sumstat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.1);
}

/* The Label (e.g., "UKUPAN BROJ UGOVORA") */
.sumstat-label {
    font-size: 0.85rem;
    color: #6c757d; /* Muted gray */
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    margin-bottom: 8px;
}

/* The Number/Value (e.g., "37,208") */
.sumstat-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: #2c3e50; /* Dark blue/gray */
    line-height: 1.2;
}

/* Smaller font for the Date Range so it fits */
.sumstat-value.small {
    font-size: 1.1rem; 
    color: #34495e;
}

/* --- 1. LINKS SECTION (Modern Pills) --- */
.links-section {
    background-color: #f8f9fa; /* Very light gray to separate from content */
    padding: 50px 20px;
    border-top: 1px solid #eef2f7;
}

.links-group {
    margin-bottom: 30px;
}

.links-title {
    font-size: 0.9rem;
    text-transform: uppercase;
    color: #6c757d;
    font-weight: 700;
    margin-bottom: 15px;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* The Grid for Pills */
.pills-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

/* The Individual Pill Button */
.city-pill {
    background: white;
    border: 1px solid #e2e8f0;
    padding: 8px 16px;
    border-radius: 50px; /* Full rounded pill */
    color: #334155;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.city-pill:hover {
    background: #1e3c72; /* Brand Blue */
    color: white;
    border-color: #1e3c72;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(30, 60, 114, 0.2);
}

.seo-container {
    max-width: 1200px;
    margin: 0 auto;
}

.seo-heading {
    text-align: center;
    font-size: 1.8rem;
    margin-bottom: 40px;
    font-weight: 700;
    color: white;
}

/* 3-Column Grid for Text */
.seo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.seo-card {
    background: rgba(255, 255, 255, 0.4); /* Glassmorphism effect */
    padding: 25px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.seo-card h3 {
    font-size: 1.2rem;
    margin-bottom: 15px;
    color: #93c5fd; /* Light blue accent text */
    font-weight: 600;
}

.seo-card p {
    line-height: 1.6;
    color: #e0f2fe; /* Off-white text */
    font-size: 0.95rem;
    margin: 0;
}