#map {
    height: 60vh;
    width: 100%;
    border: 2px solid #333;
    margin-top: 10px;
    max-width: 100%;
}

h1 a {
    color: white;
    text-decoration: none;
}

h1 a:hover {
    text-decoration: none;
    color: #ddd;
}
h1 {
    color: white;
    font-size: 2.5em;
    text-align: center;
    margin: 10px;
}
h2 {
    color: white;
}
body {
    background-color: black;
    margin: 0 !important;
    padding: 0 !important;
    width: 100vw;
    overflow-x: hidden;
}

.dark-input {
    background-color: black !important;
    color: white !important;
    padding: 8px !important;
    border: 1px solid #444 !important;
}

/* Enhanced Navbar Styles */
.custom-navbar {
    background: linear-gradient(90deg, rgba(26, 26, 26, 0.95) 0%, rgba(43, 16, 85, 0.95) 100%);
    padding: 0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid rgba(107, 70, 193, 0.3);
    width: 100%;
    z-index: 1030;
}

.nav-logo-text {
    font-weight: 700;
    font-size: 1.5rem;
    color: #a78bfa;
    letter-spacing: 1px;
    background: linear-gradient(45deg, #a78bfa, #6b46c1);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.navbar-dark .navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.85);
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
    border-radius: 6px;
    margin: 0;
    font-weight: 500;
    position: relative;
    overflow: hidden;
}

.navbar-dark .navbar-nav .nav-item:first-child .nav-link {
    margin-left: 0;
    padding-left: 1rem;
}

.navbar-dark .navbar-nav .nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #a78bfa, #6b46c1);
    transition: all 0.3s ease;
    transform: translateX(-50%);
    opacity: 0;
}

.navbar-dark .navbar-nav .nav-link:hover::after,
.navbar-dark .navbar-nav .nav-link:focus::after {
    width: 80%;
    opacity: 1;
}

.navbar-dark .navbar-nav .nav-link:hover,
.navbar-dark .navbar-nav .nav-link:focus {
    color: #a78bfa;
    background-color: rgba(107, 70, 193, 0.1);
    transform: translateY(-2px);
}

.nav-icon {
    margin-right: 6px;
    font-size: 0.9rem;
    opacity: 0.8;
}

.auth-link {
    background: linear-gradient(45deg, rgba(107, 70, 193, 0.2), rgba(167, 139, 250, 0.2));
    border-radius: 6px;
    margin-left: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.auth-link:hover {
    background: linear-gradient(45deg, rgba(107, 70, 193, 0.3), rgba(167, 139, 250, 0.3));
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.user-menu-link {
    background: linear-gradient(45deg, rgba(107, 70, 193, 0.2), rgba(167, 139, 250, 0.2));
    border-radius: 6px;
    padding: 0.6rem 1.2rem;
    font-weight: 500;
}

.user-menu-link:hover {
    background: linear-gradient(45deg, rgba(107, 70, 193, 0.3), rgba(167, 139, 250, 0.3));
}

.navbar-dark .navbar-toggler {
    border-color: rgba(107, 70, 193, 0.5);
    padding: 0.35rem 0.6rem;
    border-radius: 6px;
    background: rgba(107, 70, 193, 0.2);
    margin-left: 0;
    position: relative;
    z-index: 1050;
}

.navbar-dark .navbar-toggler:focus {
    box-shadow: 0 0 0 0.2rem rgba(167, 139, 250, 0.3);
}

/* Enhanced Dropdown Menu Styles */
.custom-dropdown {
    padding: 0.75rem 0;
    margin: 0.5rem 0 0;
    border-radius: 8px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
    background-color: rgba(26, 26, 26, 0.95);
    border: 1px solid rgba(107, 70, 193, 0.3);
    backdrop-filter: blur(10px);
    min-width: 200px;
}

.nav-dropdown-item {
    padding: 0.75rem 1.5rem;
    transition: all 0.2s ease;
    color: rgba(255, 255, 255, 0.85);
    display: flex;
    align-items: center;
}

.nav-dropdown-item i {
    margin-right: 10px;
    font-size: 0.9rem;
    color: #a78bfa;
    width: 20px;
    text-align: center;
}

.nav-dropdown-item:hover,
.nav-dropdown-item:focus {
    background: linear-gradient(45deg, rgba(107, 70, 193, 0.2), rgba(167, 139, 250, 0.2)) !important;
    color: #ffffff !important;
    transform: translateX(5px);
}

.dropdown-divider {
    border-color: rgba(107, 70, 193, 0.3);
    margin: 0.5rem 1rem;
}

@media (max-width: 991px) {
    .custom-navbar {
        padding: 0.5rem 1rem;
    }
    
    .navbar-brand {
        margin-right: 0;
        margin-left: auto;
    }
    
    .navbar-collapse {
        background: rgba(26, 26, 26, 0.98);
        border-radius: 8px;
        padding: 1rem;
        margin-top: 0.5rem;
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
        border: 1px solid rgba(107, 70, 193, 0.3);
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        z-index: 1040;
        max-height: 80vh;
        overflow-y: auto;
    }
    
    .navbar-nav {
        padding: 0.5rem 0;
    }
    
    .navbar-dark .navbar-nav .nav-link::after {
        display: none;
    }
    
    .navbar-dark .navbar-nav .nav-link:hover,
    .navbar-dark .navbar-nav .nav-link:focus {
        transform: none;
        background-color: rgba(107, 70, 193, 0.2);
    }
    
    .auth-link, .user-menu-link {
        margin: 0.25rem 0;
    }
    
    .navbar-dark .navbar-toggler {
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
        transition: all 0.3s ease;
    }
    
    .navbar-dark .navbar-toggler:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
        background: rgba(107, 70, 193, 0.3);
    }
}

@media (max-width: 991.98px) {
  .navbar-dark .navbar-nav .nav-item:first-child .nav-link {
    padding-left: 1rem; /* Match other items */
  }
  .navbar-dark .navbar-nav.ms-auto .nav-item:first-child .nav-link {
    padding-left: 1rem; /* Also fix auth links list */
  }
  .navbar-dark .navbar-nav .nav-item {
    margin-bottom: 0.35rem; /* space between stacked buttons */
  }
  .navbar-dark .navbar-nav .nav-item:last-child {
    margin-bottom: 0; /* no extra after last */
  }
}

@media (min-width: 992px) {
  .navbar-dark .navbar-nav:not(.ms-auto) .nav-item:first-child .nav-link {
    padding-left: 1.5rem;
  }
}

.dark-input {
    border-radius: 4px !important;
    min-width: 120px;
}
label {
    color: white;
}
form {
    color: white;
}
#bg-video {
    position: fixed;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    transform: translate(-50%, -50%);
    z-index: -1;
    object-fit: cover;
    pointer-events: none;
}

p {
    color: white;
}
ul {
    color: white;
    list-style-position: inside; 
    padding: 0;
}
blockquote {
    font-style: italic; 
    margin: 2em auto; 
    max-width: 600px;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
.graph-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5em; /* Increased gap for better spacing */
    margin: 2em auto;
    padding: 1em;
    max-width: 1400px;
}
.graph-box {
    height: 400px; /* Consistent height for charts */
    width: 100%; /* Ensure chart fills its container */
}
.graph-resizable {
    resize: both;
    overflow: hidden; /* Hide scrollbars unless truly needed by content */
    min-width: 300px;
    min-height: 350px; /* Adjusted min-height for ApexCharts */
    height: 400px;
    width: 100%;
    max-width: 100%;
    padding: 0.5em;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-sizing: border-box;
    background-color: black; /* Ensure background is black for consistency */
    flex-grow: 1;
    border-radius: 8px; /* Slightly rounded corners for modern look */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3); /* Subtle shadow */
}
/* Specific styles for compare_countries container */
.compare-countries-container, .country-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.5em;
}
@media (max-width: 600px) {
    .indicator-grid {
      grid-template-columns: 1fr !important;
    }
    .graph-resizable {
        width: 100% !important;
        min-width: unset; /* Allow smaller width on small screens */
    }
}

.map-container {
    margin: auto;
    padding: 1em;
    width: 100%;
}

.indicator-grid {
    display: grid;
    grid-template-columns: repeat(3, auto);
    gap: 8px;
    margin-top: 10px;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    margin-top: 2rem;
}

.search-container-wrapper {
    padding: 1rem 0;
    display: flex;
    justify-content: center;
    width: 100%;
}

.search-container {
    position: relative;
    width: 100%;
    max-width: 400px;
}

.search-icon {
    position: absolute;
    top: 50%;
    left: 15px;
    transform: translateY(-50%);
    color: #888;
}

.search-input {
    width: 100%;
    padding: 12px 20px 12px 45px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background-color: #1c1f26;
    color: #fff;
    font-size: 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: #a78bfa;
    box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.2);
}


@media (max-width: 600px) {
    .indicator-grid {
        grid-template-columns: 1fr !important;
    }

    .graph-resizable {
        width: 100% !important;
        min-width: 0;
    }

    .compare-container {
        width: 95vw;
    }
}

/* New Homepage Styles */
.home-container {
    width: 100%;
    overflow-x: hidden;
}

.hero-section {
    background: linear-gradient(135deg, rgba(16, 16, 24, 0.95) 0%, rgba(28, 20, 44, 0.98) 100%), url('https://images.unsplash.com/photo-1518186285589-2f7649de83e0?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1770&q=80') no-repeat center center/cover;
    color: #fff;
    padding: 120px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
}

.hero-content {
    max-width: 800px;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #fff;
}

.hero-subtitle {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    color: rgba(255, 255, 255, 0.85);
}

.hero-cta {
    font-size: 1.1rem;
    padding: 12px 30px;
    border-radius: 8px;
    font-weight: 500;
}

.features-section, .data-sources-section, .final-cta-section {
    padding: 80px 20px;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 600;
    margin-bottom: 3rem;
    color: #fff;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.feature-card-link {
    text-decoration: none;
}

.feature-card {
    background: #1c1f26;
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    border: 1px solid rgba(107, 70, 193, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    opacity: 0;
    transform: translateY(20px);
}

.feature-card.in-view {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 20px rgba(107, 70, 193, 0.15);
}

.feature-icon {
    font-size: 2.5rem;
    color: #a78bfa;
    margin-bottom: 1.5rem;
}

.feature-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #fff;
}

.feature-description {
    color: rgba(255, 255, 255, 0.7);
}

.data-sources-section {
    background-color: #1c1f26;
}

.data-sources-text {
    max-width: 700px;
    margin: 0 auto 2rem auto;
    color: rgba(255, 255, 255, 0.8);
}

.source-logos {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.source-logo {
    font-size: 1.2rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 10px 20px;
    border-radius: 8px;
}

.final-cta-section {
    background: linear-gradient(135deg, rgba(28, 20, 44, 0.98) 0%, rgba(43, 16, 85, 0.95) 100%);
}

.final-cta-text {
    max-width: 600px;
    margin: 0 auto 2rem auto;
    color: rgba(255, 255, 255, 0.85);
}

@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }
    .hero-subtitle {
        font-size: 1.1rem;
    }
    .section-title {
        font-size: 2rem;
    }
}


/* --- HOMEPAGE/NEWS FEED STYLES (KEEP THESE) --- */
:root {
    --accent-purple: #a78bfa;
    --accent-purple-dark: #8b5cf6;
}

.brand-logo-text {
    font-weight: 700;
    font-size: 1.45rem;
    letter-spacing: -0.5px;
    font-family: 'Inter', 'Segoe UI', 'Roboto', 'Arial', sans-serif;
    display: flex;
    align-items: center;
    padding-left: 0.1rem;
    padding-right: 0.7rem;
}
.brand-logo-purple {
    color: #a78bfa;
    font-weight: 800;
    letter-spacing: -0.5px;
    font-family: inherit;
}
.brand-logo-white {
    color: #fff;
    font-weight: 800;
    letter-spacing: -0.5px;
    font-family: inherit;
    margin-left: 0.1rem;
}

.brand-logo-text:hover .brand-logo-purple,
.brand-logo-text:focus .brand-logo-purple {
    color: #8b5cf6;
}

.btn-primary {
    background-color: #a78bfa !important;
    border-color: #a78bfa !important;
}

.btn-primary:hover {
    background-color: #8b5cf6 !important;
    border-color: #8b5cf6 !important;
}

.btn-secondary {
    background-color: #7c3aed !important;
    border-color: #7c3aed !important;
}

.btn-secondary:hover {
    background-color: #6d28d9 !important;
    border-color: #6d28d9 !important;
}

/* Correlation page styles */
.correlation-container,
.correlation-results-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.correlation-map {
    height: 60vh;
    width: 100%;
    border: 2px solid #333;
    margin: 1.5rem auto;
    max-width: 100%;
    border-radius: 8px;
}

.correlation-intro {
    color: white;
    margin: 1.5rem auto;
    max-width: 800px;
    font-size: 1.1rem;
}

.correlation-form-container {
    background: rgba(26, 26, 26, 0.95);
    border-radius: 1rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(107, 70, 193, 0.2);
    padding: 2rem;
    margin: 2rem auto;
    max-width: 800px;
}

.correlation-form-group {
    margin-bottom: 1.5rem;
    text-align: left;
}

.correlation-form-row {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.correlation-form-row .correlation-form-group {
    flex: 1;
    margin-bottom: 0;
}

.correlation-form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: white;
    font-weight: 500;
}

.correlation-form-group select,
.correlation-form-group input {
    width: 100%;
    padding: 0.8rem;
    border-radius: 0.5rem;
    background-color: black;
    color: white;
    border: 1px solid #444;
}

.correlation-info {
    background: rgba(26, 26, 26, 0.95);
    border-radius: 1rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(107, 70, 193, 0.2);
    padding: 2rem;
    margin: 2rem auto;
    max-width: 800px;
    color: white;
}

.correlation-info h3 {
    color: #a78bfa;
    margin-bottom: 1rem;
}

.correlation-info ul {
    margin-left: 1.5rem;
    margin-bottom: 1.5rem;
}

.correlation-info li {
    margin-bottom: 0.5rem;
}

/* Correlation results styles */
.correlation-summary {
    background: rgba(26, 26, 26, 0.95);
    border-radius: 1rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(107, 70, 193, 0.2);
    padding: 2rem;
    margin: 2rem auto;
    max-width: 800px;
    color: white;
    text-align: center;
}

.correlation-coefficient {
    margin: 2rem 0;
}

.correlation-value {
    font-size: 2rem;
    font-weight: bold;
    color: #a78bfa;
}

.correlation-scale {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 1.5rem 0;
    gap: 1rem;
}

.scale-bar {
    position: relative;
    width: 60%;
    height: 10px;
    background: linear-gradient(to right, #d62728, #7f7f7f, #2ca02c);
    border-radius: 5px;
}

.scale-indicator {
    position: absolute;
    top: -5px;
    width: 20px;
    height: 20px;
    background-color: white;
    border-radius: 50%;
    transform: translateX(-50%);
}

.scale-label {
    font-weight: bold;
    color: white;
}

.correlation-interpretation {
    margin-top: 1.5rem;
    font-size: 1.1rem;
    line-height: 1.6;
}

.correlation-charts {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    margin: 2rem 0;
}

.correlation-chart {
    flex: 1;
    min-width: 300px;
    height: 400px;
    background-color: rgba(0, 0, 0, 0.8);
    border-radius: 0.5rem;
    border: 1px solid rgba(107, 70, 193, 0.2);
}

.correlation-error {
    color: #ff6b6b;
    font-style: italic;
    margin: 2rem 0;
}

@media (max-width: 768px) {
    .correlation-form-row {
        flex-direction: column;
    }
    
    .correlation-charts {
        flex-direction: column;
    }
    
    .correlation-chart {
        width: 100%;
    }
}

/* Rankings page styles */
.rankings-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.rankings-intro {
    color: white;
    margin: 1.5rem auto;
    max-width: 800px;
    text-align: center;
}

.rankings-form-container {
    background: rgba(26, 26, 26, 0.95);
    border-radius: 1rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(107, 70, 193, 0.2);
    padding: 2rem;
    margin: 2rem auto;
    max-width: 800px;
}

.rankings-form-row {
    display: flex;
    justify-content: space-between;
    gap: 2rem;
    margin-bottom: 1.5rem;
}

.rankings-form-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.rankings-info {
    background: rgba(26, 26, 26, 0.95);
    border-radius: 1rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(107, 70, 193, 0.2);
    padding: 2rem;
    margin: 2rem auto;
    max-width: 800px;
    color: white;
}

.rankings-info h3 {
    color: #a78bfa;
    margin-bottom: 1rem;
}

.rankings-info ul {
    margin-left: 1.5rem;
    margin-bottom: 1.5rem;
}

.rankings-info li {
    margin-bottom: 0.5rem;
}

/* Rankings results styles */
.rankings-results-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.rankings-results {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    margin: 2rem 0;
}

.rankings-table-container {
    flex: 1;
    min-width: 300px;
    max-width: 600px;
    background: rgba(26, 26, 26, 0.95);
    border-radius: 1rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(107, 70, 193, 0.2);
    padding: 1rem;
    overflow-y: auto;
    max-height: 600px;
}

.rankings-visualization {
    flex: 1;
    min-width: 300px;
    height: 600px;
    background: rgba(26, 26, 26, 0.95);
    border-radius: 1rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(107, 70, 193, 0.2);
    padding: 1rem;
    display: flex; /* Use flexbox to make the chart fill the container */
}

#rankings-chart {
    width: 100%;
    height: 100%;
}

.rankings-table {
    width: 100%;
    border-collapse: collapse;
    color: white;
}

.rankings-table th {
    background-color: rgba(107, 70, 193, 0.2);
    padding: 0.75rem;
    text-align: left;
    border-bottom: 2px solid rgba(107, 70, 193, 0.3);
}

.rankings-table td {
    padding: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.rankings-table tr:hover {
    background-color: rgba(107, 70, 193, 0.1);
}

.rank-cell {
    font-weight: bold;
    color: #a78bfa;
    text-align: center;
}

.country-cell {
    font-weight: bold;
}

.value-cell {
    text-align: right;
}

.country-link {
    color: white;
    text-decoration: none;
    transition: color 0.3s;
}

.country-link:hover {
    color: #a78bfa;
    text-decoration: underline;
}

.data-source {
    font-style: italic;
    color: #888;
    margin-top: 1rem;
}
#selected-countries {
    margin: 20px auto; 
    max-width: 600px;
    text-align: center;
}

.sidebar-ticker-outer {
    flex-grow: 1;
    min-height: 0; /* Critical for flex child sizing */
    overflow: hidden;
    position: relative;
    width: 100%;
    margin: 0 auto;
}
.sidebar-ticker {
    transition: transform 0.7s cubic-bezier(0.4,0.2,0.2,1);
    will-change: transform;
}

.img-fallback {
    width: 100%;
    height: 100%;
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    color: #a78bfa;
    background: #23272b;
    border-radius: 0.7rem;
}

/* Tic-tac-toe styles */
.cell {
    width: 100px;
    height: 100px;
    background: rgba(26, 26, 26, 0.95);
    border: 2px solid #a78bfa;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    color: white;
    cursor: pointer;
    transition: background-color 0.3s;
}

.cell:hover {
    background: rgba(38, 38, 38, 0.98);
}

#bored_button {
    display: block;
    margin: 20px auto;
}

#game_status {
    color: white;
    font-size: 1.2em;
}

#tictactoe {
    display: grid;
    grid-template-columns: repeat(3, 100px);
    gap: 5px;
    margin: 0 auto;
    width: fit-content;
}

#game_container {
    margin: 20px 0;
    text-align: center;
}

#restart_game {
    margin: 10px auto;
    display: block;
}

/* About page styles */
.about-page {
    width: 100%;
    min-height: 100vh;
}

.about-hero {
    background: linear-gradient(135deg, rgba(28, 20, 44, 0.98) 0%, rgba(43, 16, 85, 0.95) 100%);
    padding: 80px 20px;
    text-align: center;
    border-bottom: 1px solid rgba(107, 70, 193, 0.3);
}

.about-hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.about-brand {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.about-brand a {
    text-decoration: none;
}

.about-tagline {
    font-size: 1.3rem;
    color: rgba(255, 255, 255, 0.85);
    margin: 0;
}

.about-content-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 60px 20px;
}

.about-section {
    margin-bottom: 60px;
}

.about-section-content {
    max-width: 800px;
    margin: 0 auto;
}

.about-section-title {
    font-size: 2rem;
    font-weight: 600;
    color: #a78bfa;
    margin-bottom: 2rem;
    text-align: center;
}

.about-description {
    font-size: 1.1rem;
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.85);
    text-align: center;
}

.about-features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.about-feature-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    height: 100%;
}

.about-feature-item {
    background: rgba(26, 26, 26, 0.95);
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid rgba(107, 70, 193, 0.2);
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.about-feature-item:hover {
    transform: translateY(-5px);
    border-color: rgba(107, 70, 193, 0.5);
    box-shadow: 0 10px 30px rgba(107, 70, 193, 0.2);
}

.about-feature-highlight {
    background: linear-gradient(135deg, rgba(107, 70, 193, 0.15) 0%, rgba(167, 139, 250, 0.1) 100%);
    border-color: rgba(107, 70, 193, 0.4);
    position: relative;
}

.about-feature-highlight::before {
    content: "MOST POPULAR";
    position: absolute;
    top: 12px;
    right: 12px;
    background: #a78bfa;
    color: #000;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 4px;
    letter-spacing: 0.5px;
}

.about-feature-highlight:hover {
    background: linear-gradient(135deg, rgba(107, 70, 193, 0.2) 0%, rgba(167, 139, 250, 0.15) 100%);
    border-color: rgba(107, 70, 193, 0.6);
}

.about-feature-icon {
    font-size: 2.5rem;
    color: #a78bfa;
    margin-bottom: 1rem;
}

.about-feature-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 0.5rem;
}

.about-feature-desc {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.7);
    margin: 0;
}

.about-two-column {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 3rem;
    margin-bottom: 60px;
    align-items: stretch;
}

.about-thanks,
.about-sources {
    display: flex;
    flex-direction: column;
}

.about-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.about-list-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    margin-bottom: 0.75rem;
    background: rgba(26, 26, 26, 0.95);
    border-radius: 8px;
    border: 1px solid rgba(107, 70, 193, 0.2);
    transition: all 0.3s ease;
    min-height: 70px;
}

.about-list-icon {
    color: #a78bfa;
    font-size: 1.2rem;
    margin-top: 0.2rem;
    flex-shrink: 0;
}

.about-list-item span {
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.6;
}

.about-contact {
    text-align: center;
}

.about-contact-email {
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.about-contact-email a {
    color: #a78bfa;
    text-decoration: none;
    transition: color 0.3s ease;
}

.about-contact-email a:hover {
    color: #8b5cf6;
    text-decoration: underline;
}

.about-contact-icon {
    color: #a78bfa;
    font-size: 1.5rem;
}

.about-fun {
    text-align: center;
    padding: 3rem 0;
    background: rgba(0, 0, 0, 0);
    border-radius: 12px;
    border: 1px solid rgba(107, 70, 193, 0.2);
}

.about-game-button {
    font-size: 1.1rem;
    padding: 12px 30px;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.about-game-container {
    display: none;
    margin-top: 2rem;
}

.about-game-status {
    color: white;
    font-size: 1.2rem;
    margin: 1.5rem 0 1rem 0;
}

.about-restart-button {
    display: none;
}

@media (max-width: 768px) {
    .about-brand {
        font-size: 2.5rem;
    }

    .about-tagline {
        font-size: 1.1rem;
    }

    .about-section-title {
        font-size: 1.75rem;
    }

    .about-features-grid {
        grid-template-columns: 1fr;
    }

    .about-two-column {
        grid-template-columns: 1fr;
    }
}

/* Advanced Chart Styles */
.advanced-chart-container {
    padding: 10px;
}

.symbol-title {
    font-size: 20px;
    font-weight: 600;
}

@media (min-width: 576px) {
    .advanced-chart-container {
        padding: 20px;
    }
    
    .symbol-title {
        font-size: 24px;
    }
}

.price-change {
    font-size: 16px;
    font-weight: 500;
}

.chart-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
}

.chart-toolbar .btn-group {
    background-color: #1e222d;
}

.chart-toolbar .btn {
    padding: 4px 8px;
    font-size: 12px;
}

@media (min-width: 576px) {
    .chart-toolbar .btn {
        padding: 5px 15px;
        font-size: 14px;
    }
}

.analysis-box {
    padding: 12px;
    border-radius: 8px;
    background-color: #1e222d;
    margin-bottom: 10px;
    height: 100%;
}

.analysis-box h6 {
    margin-bottom: 12px;
    color: #d1d4dc;
    font-size: 14px;
}

@media (min-width: 576px) {
    .analysis-box h6 {
        font-size: 16px;
    }
}

.analysis-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    padding: 6px;
    border-radius: 4px;
    background-color: #2b2b43;
    font-size: 12px;
}

@media (min-width: 576px) {
    .analysis-item {
        padding: 8px;
        font-size: 14px;
    }
}

.analysis-item span:first-child {
    color: #d1d4dc;
}

.search-container {
    min-width: 200px;
}

@media (min-width: 576px) {
    .search-container {
        width: 300px;
    }
}

#symbolSearch {
    border: 1px solid #2b2b43;
    border-radius: 4px;
    padding: 6px 10px;
    font-size: 14px;
    width: 100%;
}

@media (min-width: 576px) {
    #symbolSearch {
        padding: 8px 12px;
    }
}

#symbolSearch:focus {
    border-color: #2962FF;
    box-shadow: none;
    outline: none;
}

/* Drawing Tools Menu */
.drawing-tools {
    position: absolute;
    top: 50px;
    right: 10px;
    background-color: #1e222d;
    border: 1px solid #2b2b43;
    border-radius: 4px;
    padding: 8px;
    z-index: 1000;
}

.drawing-tools button {
    display: block;
    width: 100%;
    text-align: left;
    padding: 6px 10px;
    border: none;
    background: none;
    color: #d1d4dc;
    cursor: pointer;
    font-size: 12px;
}

@media (min-width: 576px) {
    .drawing-tools {
        padding: 10px;
    }
    
    .drawing-tools button {
        padding: 8px 12px;
        font-size: 14px;
    }
}

.drawing-tools button:hover {
    background-color: #2b2b43;
}

/* Indicator Settings Modal */
.indicator-settings {
    background-color: #1e222d;
    padding: 12px;
    border-radius: 8px;
}

.indicator-settings label {
    color: #d1d4dc;
    margin-bottom: 4px;
    font-size: 12px;
}

.indicator-settings input[type="number"] {
    background-color: #2b2b43;
    border: 1px solid #363a45;
    color: #d1d4dc;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
}

@media (min-width: 576px) {
    .indicator-settings {
        padding: 15px;
    }
    
    .indicator-settings label {
        margin-bottom: 5px;
        font-size: 14px;
    }
    
    .indicator-settings input[type="number"] {
        padding: 5px 10px;
        font-size: 14px;
    }
}

.chart-wrapper {
    position: relative;
    min-height: 600px;
    height: 600px;
    padding-bottom: 60px; /* space for volume bars */
}
@media (max-width: 576px) {
    .chart-wrapper {
        min-height: 340px;
        height: 340px;
        padding-bottom: 40px;
    }
}

.fullscreen-parent, .fullscreen-parent-body {
    position: fixed !important;
    top: 0;
    left: 0;
    width: 100vw !important;
    height: 100vh !important;
    min-height: 100vh !important;
    max-height: 100vh !important;
    padding: 0 !important;
    margin: 0 !important;
    background: #181c23 !important;
    z-index: 9998 !important;
    box-shadow: none !important;
    border: none !important;
    display: block !important;
}
.fullscreen-chart {
    width: 100vw !important;
    height: 100vh !important;
    max-width: 100vw !important;
    max-height: 100vh !important;
    position: fixed !important;
    top: 0;
    left: 0;
    z-index: 1050;
    background: #181b23;
}
.fullscreen-chart .chart-toolbar {
    width: 100% !important;
    position: absolute !important;
    top: 0;
    left: 0;
    z-index: 1100;
    background: rgba(24,27,35,0.95);
    border-bottom: 1px solid #222;
    padding: 8px 16px;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
}
.fullscreen-chart, .fullscreen-chart #tradingViewChart, .fullscreen-chart #drawCanvas {
    width: 100vw !important;
    height: 100vh !important;
    min-height: 100vh !important;
    max-width: 100vw !important;
    max-height: 100vh !important;
}
.fullscreen-chart #tradingViewChart {
    margin-top: 48px; /* space for toolbar */
    height: calc(100vh - 48px) !important;
}
body.fullscreen-chart-active {
    overflow: hidden;
}

/* Ensure the draw canvas is always on top in fullscreen */
.fullscreen-chart #drawCanvas {
    z-index: 1200 !important;
}

/* Chart App Styles */
.chart-app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: var(--bs-dark);
    color: var(--bs-light);
}

/* Header Styles */
.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background-color: #1c1f26;
    border-bottom: 1px solid #2e323b;
    gap: 1rem;
    flex-wrap: wrap;
    width: 100%; /* Ensure it spans full width */
}

.symbol-info {
    flex-grow: 1; /* Allow this element to grow and push the search bar to the right */
    flex-shrink: 0; /* Prevent the symbol info from shrinking */
}

.symbol-info h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.price-change {
    font-size: 1.1rem;
    font-weight: 500;
}

/* Main Chart Area */
.chart-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0; /* Important for flex child scrolling */
    position: relative;
    padding: 1rem;
    gap: 1rem;
}

/* Chart Controls */
.chart-controls {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: space-between;
    padding-bottom: 0.5rem;
}

.control-group {
    display: flex;
    gap: 0.25rem;
    flex-wrap: wrap;
}

.control-group.intervals {
    flex: 1;
    min-width: 300px;
}

.control-group.tools {
    gap: 0.5rem;
}

/* Chart Container */
.chart-container {
    flex: 1;
    position: relative;
    min-height: 400px;
    background: rgba(24, 27, 35, 0.95);
    border-radius: 8px;
    overflow: hidden;
    width: 100%;
    height: 100%;
}

#tradingViewChart {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
}

#drawCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
}

/* Analysis Panels */
.analysis-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-top: 1rem;
    width: 100%;
}

.analysis-group {
    background: rgba(24, 27, 35, 0.95);
    border-radius: 8px;
    padding: 1rem;
}

.analysis-group h6 {
    margin-bottom: 1rem;
    color: var(--bs-gray-400);
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.analysis-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    margin-bottom: 0.5rem;
}

.analysis-item:last-child {
    margin-bottom: 0;
}

.analysis-item span {
    font-size: 0.9rem;
}

.analysis-item strong {
    font-size: 0.9rem;
    font-weight: 600;
    margin-left: 0.5rem;
}

/* Search Bar Improvements */
.search-container {
    position: relative;
    min-width: 250px;
    max-width: 400px;
    display: flex; /* Use flexbox to align items */
}

.search-container .form-control {
    flex: 1 1 auto;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.search-container .btn {
    flex-shrink: 0;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

/* Mobile Responsive Adjustments */
@media (max-width: 768px) {
    .analysis-container {
        grid-template-columns: 1fr;
    }

    .search-container {
        max-width: none;
        width: 100%;
    }
}

/* Signal Colors */
.text-success {
    color: #26a69a !important;
}

.text-danger {
    color: #ef5350 !important;
}

.text-warning {
    color: #ffa726 !important;
}

.search-button {
    padding: 12px 24px;
    background-color: #2196F3;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(33, 150, 243, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.search-button:hover {
    background-color: #1976D2;
    box-shadow: 0 4px 8px rgba(33, 150, 243, 0.3);
    transform: translateY(-1px);
}

.search-button:active {
    background-color: #1565C0;
    box-shadow: 0 2px 4px rgba(33, 150, 243, 0.2);
    transform: translateY(0);
}

.search-button:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.3);
}

.search-button:disabled {
    background-color: #90CAF9;
    cursor: not-allowed;
    transform: none;
}

.search-button i {
    font-size: 18px;
}

/* Chart Fullscreen Mode */
.chart-app.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9990;
    background-color: rgb(24, 27, 35);
    padding: 20px;
    box-sizing: border-box;
}

.chart-app.fullscreen #tradingViewChart {
    width: 100%;
    height: calc(100% - 60px);
}

/* Search Results Dropdown */
.ohlc-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 0.5rem;
}

.ohlc-data {
    display: flex;
    gap: 0.75rem;
    font-size: 0.9rem;
    color: #d1d4dc;
}

.ohlc-label {
    font-weight: 600;
    color: #8c8c8c;
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: #1c1f26;
    border: 1px solid #2e323b;
    border-top: none;
    border-radius: 0 0 6px 6px;
    z-index: 1000;
    max-height: 300px;
    overflow-y: auto;
    display: none; /* Initially hidden */
}

.search-result-item {
    padding: 12px 15px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    border-bottom: 1px solid #2e323b;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background-color: #2e323b;
}

.search-result-item .symbol {
    font-weight: 600;
    color: #fff;
}

.search-result-item .company {
    font-size: 0.9rem;
    color: #d1d4dc;
    margin-left: 10px;
}


/* Responsive adjustments */
@media (max-width: 600px) {
    .search-container {
        max-width: 100%;
        padding: 0 10px;
    }
}

.chart-app.fullscreen .search-container {
    display: none;
}

.chart-app.fullscreen .chart-header {
    display: none;
}

#indicatorsModal {
    z-index: 10500; /* Ensure it's above the fullscreen chart */
}

.indicator-btn {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 0.75rem 1rem;
    background-color: transparent;
    border: 1px solid #3e434e;
    color: #d1d4dc;
    margin-bottom: 0.5rem;
    border-radius: 0.375rem;
    transition: background-color 0.2s, color 0.2s;
    text-align: left;
}

.indicator-btn:hover {
    background-color: #3e434e;
    color: #fff;
}

.indicator-btn i {
    margin-right: 0.75rem;
    color: #8c8c8c;
    width: 20px;
    text-align: center;
}

#indicatorsModal .modal-content {
    background-color: #1c1f26;
    color: #d1d4dc;
    border: 1px solid #2e323b;
}

#indicatorsModal .modal-header {
    border-bottom: 1px solid #2e323b;
}

#indicatorsModal .modal-body {
    background-color: #181a20;
}

#indicatorsModal .modal-title {
    color: #fff;
}

/* Mobile Responsive Adjustments for Chart Page */
@media (max-width: 768px) {
    .chart-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .symbol-info h2 {
        font-size: 1.25rem;
    }

    .search-container {
        width: 100%;
        max-width: none;
    }
}

/* Chart-specific styles */
.graph-resizable {
    position: relative; /* Needed for positioning the drag handle */
}
.drag-handle {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 28px;
    height: 28px;
    cursor: grab;
}

/* Search container on map pages */
.search-container-wrapper {
    padding: 1rem 0;
    display: flex;
    justify-content: center;
    width: 100%;
}

.search-container {
    position: relative;
    max-width: 400px;
    margin: 0 auto; /* Center the block element */
}

.search-input {
    text-align: center; /* Center the placeholder text */
    width: 100%;
    padding: 12px 20px 12px 45px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background-color: #1c1f26;
    color: #fff;
    font-size: 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.search-icon {
    position: absolute;
    top: 50%;
    left: 15px;
    transform: translateY(-50%);
    color: #888;
}

.search-input {
    width: 100%;
    padding: 12px 20px 12px 45px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background-color: #1c1f26;
    color: #fff;
    font-size: 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: #a78bfa;
    box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.2);
}

.compare-map {
    height: 400px; /* Or any other appropriate height */
}

/* New Control Bar Styles */
.controls-container {
    margin-bottom: 1.5rem;
}

.controls-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: #1c1f26;
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    border: 1px solid rgba(107, 70, 193, 0.2);
}

.control-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.control-group label {
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
}

.control-input {
    background: #121212;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    border-radius: 8px;
    padding: 8px 12px;
    width: 120px;
}

.indicators-group {
    position: relative;
}

.indicators-details summary {
    cursor: pointer;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: 8px;
    background: #2a2d35;
    transition: background-color 0.2s ease;
}

.indicators-details[open] summary {
    background-color: #a78bfa;
    color: #fff;
}

.indicator-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    background: #1c1f26;
    border: 1px solid rgba(107, 70, 193, 0.2);
    border-radius: 12px;
    padding: 1rem;
    margin-top: 0.5rem;
    z-index: 1000;
    width: 400px; /* Increased width */
    max-height: 400px;
    overflow-y: auto;
}

#selected-countries {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin: 20px auto;
    max-width: 800px;
}

.selected-country-item {
    display: flex;
    align-items: center;
    background-color: black;
    border-radius: 8px;
    padding: 5px 10px;
    color: #fff;
    font-size: 0.9rem;
}

.selected-country-item .btn {
    margin-left: 8px;
}

#selected-countries {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin: 20px auto;
    max-width: 800px;
}

.selected-country-item {
    display: flex;
    align-items: center;
    background-color: black;
    border-radius: 8px;
    padding: 5px 10px;
    color: #fff;
    font-size: 0.9rem;
}

.selected-country-item .btn {
    margin-left: 8px;
}

.control-button {
    margin-left: auto;
}

@media (max-width: 768px) {
    .controls-bar {
        flex-wrap: wrap;
        justify-content: center;
    }
    .control-group {
        width: 100%;
        justify-content: center;
    }
    .control-input {
        width: 100%;
    }
    .indicators-group {
        width: 100%;
    }
    .indicator-dropdown {
        width: 100%;
        left: 0;
        right: 0;
    }
    .control-button {
        width: 100%;
        margin-left: 0;
    }
}