/* =============================================================== */
/* --- Jupiter Theme Top Space Override --- */
/* =============================================================== */

/* 1. This targets the main wrapper you identified and removes its top margin. */
#theme-page .theme-page-wrapper.full-width-layout {
    margin-top: 0 !important;
}

/* 2. This targets the content area inside the wrapper to remove its padding. */
.theme-page-wrapper .theme-content {
    padding-top: 0 !important;
}

/* 3. This hides the theme's default page title area, which is a very common source of unwanted space. */
.page-header, .mk-page-title-box {
    display: none !important;
}

/* --- Universal Box Sizing Reset --- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

/* --- Main Layout & Structure --- */
#achievements-app-container {
    font-family: sans-serif;
    padding: 0 1.5rem;
    position: relative;
    background-color: rgba(173,216,230,0.2);
    min-height: 100vh;
    padding-bottom: 5rem;
}
/* --- Filter Container Styles --- */
.filters-container {
    margin-bottom: 2rem;
}

.category-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.category-button {
    border: 2px solid transparent;
    border-radius: 9999px;
    padding: 0.5rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: white;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    opacity: 0.8;
}
.category-button[data-category=""] {
    color: black;
    background-color: #e2e8f0; /* A light grey background for better contrast */
}

.category-button[data-category=""].active {
    opacity: 1;
    box-shadow: 0 0 0 3px white, 0 0 0 5px #60a5fa
}

.category-button:hover {
    transform: translateY(-2px);
    opacity: 1;
}

.category-button.active {
    opacity: 1;
    box-shadow: 0 0 0 3px white, 0 0 0 5px #60a5fa;
}

.dropdown-filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

#grid-view {
	margin-top: 1rem;
}
/* --- Responsive Card Grid --- */
.cards-grid {
	margin-top: 1rem;
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 640px) {
    .cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (min-width: 1024px) {
    .cards-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}
@media (min-width: 1280px) {
    .cards-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}
@media (min-width: 1536px) {
    .cards-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

.stats-summary-text {
    text-align: center;
    font-size: 0.95rem;
    color: #4a5568;
	white-space: nowrap; 
	margin: 1rem auto 2.5rem auto; 
	line-height: 1.5;
    font-style: italic;
}

.modal-body p {
    margin-top: 0.3rem;
    margin-bottom: 0.3rem;
}

/* --- Card Styling --- */
.achievement-card {
    background-color: rgba(255,255,255,0.9);
    /*border: 1px solid #e2e8f0;*/
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03), 0 1px 2px rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    cursor: pointer;
    max-height: 125px;
    transition: max-height 0.5s ease-in-out, box-shadow 0.3s ease;
	box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.achievement-card:hover {
    max-height: 1000px;
    box-shadow: 0 10px 15px -3px rgba(255, 223, 0, 0.07), 0 4px 6px -2px rgba(255, 223, 0, 0.05);
}
/* --- START: New Styles for Top 10 Cards --- */
.achievement-card.is-top-10 {
    background: linear-gradient(145deg, #d4af37, #ffd700);
    border: 2px solid #fff200;
    box-shadow: 0 8px 25px -3px rgba(212, 175, 55, 0.4);
    animation: top10-glow 2.5s infinite ease-in-out;
    position: relative;
    overflow: hidden;
    transform-style: preserve-3d;
    /* --- This is the key change: Slower transition for the reset animation --- */
    transition: transform 0.4s ease-out; 
    transform: perspective(1000px) rotateY(var(--rotate-y, 0deg)) rotateX(var(--rotate-x, 0deg));
}

.achievement-card.is-top-10::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* A large, soft, elliptical gradient that acts as a light source reflection */
    background: radial-gradient(
        ellipse at var(--light-x, 50%) var(--light-y, 50%),
        rgba(255, 255, 255, 0.6),
        transparent 40%
    );
    mix-blend-mode: color-dodge; /* This makes the light interact realistically with the color below */
    opacity: 0;
    transition: opacity 0.2s ease-out;
}
.achievement-card.is-top-10:hover {
    transition: transform 0.05s linear;
}
.achievement-card.is-top-10:hover::before {
    opacity: 1;
}

@keyframes top10-glow {
    0% { box-shadow: 0 8px 25px -3px rgba(212, 175, 55, 0.4), 0 0 5px #ffd700; }
    50% { box-shadow: 0 8px 25px -3px rgba(212, 175, 55, 0.6), 0 0 20px #fff200; }
    100% { box-shadow: 0 8px 25px -3px rgba(212, 175, 55, 0.4), 0 0 5px #ffd700; }
}

/* This makes the header text readable on the gold background */
.achievement-card.is-top-10 .card-category-header {
    color: #2c2408; /* A dark gold/brown color for contrast */
    background-color: rgba(255, 255, 255, 0.2) !important; /* Override inline style */
}
/* --- END: New Styles for Top 10 Cards --- */


.card-category-header {
    color: white;
    font-weight: 600;
    font-size: 0.75rem;
    padding: 0.5rem 1.5rem;
    flex-shrink: 0;
}

.card-content {
    padding: 1.5rem;
    padding-top: 0.75rem;
}

.achievement-card .card-title {
    font-size: 0.8rem;
    font-weight: 600;
    margin: 0 0 1rem 0;
    color: #1a202c;
}

.card-meta {
    margin-top: 1rem;
    font-size: 0.875rem;
    color: #4a5568;
    border-top: 1px solid #e2e8f0;
    padding-top: 1rem;
    opacity: 0;
    transition: opacity 0.3s ease-in-out 0.2s;
}

.achievement-card:hover .card-meta {
    opacity: 1;
}

.card-meta-item {
    display: block;
    margin-bottom: 0.5rem;
}

.card-meta-item strong {
    color: #2d3748;
}

.card-subcategory-icons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem; /* Small gap between icons */
    margin-top: 0.75rem;
}

.card-subcategory-icon {
    width: 32px; /* Small icon size */
    height: 32px;
    border-radius: 4px;
    object-fit: cover;
}

/* --- Filter Controls --- */
.filter-group {
    display: flex;
    flex-direction: column;
}

#grid-view .filter-group select,
#grid-view .filter-group input {
    width: 100%;
    font-size: 0.9rem;
    font-weight: 600;
    color: #2d3748;
    background-color: #fff;
    border: 2px solid #cbd5e0;
    border-radius: 0.5rem;
    /* --- START: This line is updated --- */
    box-shadow: 0 1px 3px rgba(0,0,0,0.03), 0 1px 2px rgba(0,0,0,0.06);
    /* --- END: This line is updated --- */
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

/* Styles for dropdowns ONLY */
#grid-view .filter-group select {
    -webkit-appearance: none;
    appearance: none;
    padding: 0.7rem 2.5rem 0.7rem 1rem;
    cursor: pointer;
    text-overflow: ellipsis;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.75rem center;
    background-repeat: no-repeat;
    background-size: 1.2em 1.2em;
}

/* Styles for the keyword search input ONLY */
#grid-view .filter-group input {
    padding: 0.7rem 1rem;
}

/* Focus styles for both */
#grid-view .filter-group select:focus,
#grid-view .filter-group input:focus {
    outline: none;
    border-color: #292459; /* More prominent, on-brand color */
    box-shadow: 0 0 0 4px rgba(41, 36, 89, 0.2); /* A matching soft glow */
}
/* --- Loading / Error States --- */
.loading-message, .error-message {
    padding: 2rem;
    text-align: center;
    color: #718096;
    font-size: 1.1rem;
    width: 100%;
}

/* --- Modal Styles --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.is-visible {
    display: flex;
    opacity: 1;
}

.modal-window {
    background: rgba(255, 255, 255, 1); 
    backdrop-filter: blur(10px);          
    border: 10px solid rgba(255, 255, 255, 0.8); /* 3. Subtle border */
    
    border-radius: 0.75rem;
    max-width: 800px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    padding: 2rem;
    box-shadow: 0 0 15px 2px rgba(0, 0, 0, 0.9), 0 0 100px 0 rgba(0, 0, 0, 0.75);
    position: relative;
    /* --- ANIMATION CHANGES --- */
    opacity: 0; /* Start fully transparent */
    transform: translateY(20px); /* Start 20px lower */
    transition: opacity 0.3s ease-out, transform 0.3s ease-out; /* Animate both properties */

}
/* --- NEW: Custom Scrollbar for Modal --- */
/* This targets WebKit browsers like Chrome, Safari, and Edge */
.modal-window::-webkit-scrollbar {
  width: 10px; /* Sets the width of the scrollbar area */
}

.modal-window::-webkit-scrollbar-track {
  background: transparent; /* Hides the scrollbar track */
}

.modal-window::-webkit-scrollbar-thumb {
  background-color: rgba(0, 0, 0, 0.3); /* Color of the scroll pill */
  border-radius: 10px; /* Makes the pill rounded */
  border: 2px solid transparent; /* Creates padding around the pill */
  background-clip: content-box;
}

.modal-window::-webkit-scrollbar-thumb:hover {
  background-color: rgba(0, 0, 0, 0.5); /* Darkens the pill on hover */
}

.modal-overlay.is-visible .modal-window {
    /* --- ANIMATION CHANGES --- */
    opacity: 1; /* End fully opaque */
    transform: translateY(0); /* End at its natural position */
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
}

#modal-title {
    font-size: 1rem; !important
    font-weight: 600;
    margin: 0;
}

.modal-close-button {
    background: none;
    border: none;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    color: #9ca3af;
}

.modal-body {
    line-height: 1.6;
}

.modal-logo-container {
	max-width: 100px
    text-align: center;
    margin-bottom: 0.5rem;
}

.modal-logo-image {
    max-width: 200px; 
    max-height: 100px; 
    object-fit: contain; 
    height: auto;
    display: inline-block;
}

.modal-diagram-container {
    margin-top: 1.5rem;
}

.modal-diagram-image {
    width: 100%;
    height: 400px;
    object-fit: contain;
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
}

.modal-image-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 200px;
    background-color: #f1f5f9;
    border: 2px dashed #cbd5e0;
    border-radius: 0.5rem;
    color: #64748b;
    font-weight: 500;
}

/* --- Modal Sub-Category Icon Grid --- */
.modal-subcategory-grid {
    margin-top: 1.5rem;
}

.modal-subcategory-grid h4 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 1rem 0;
    color: #1a202c;
}

.modal-subcategory-icons {
    display: grid;
	grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));    
	gap: 1rem;
    text-align: center;
}

.subcategory-icon-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.subcategory-icon-img {
    width: 60px;
    height: 60px;
    border-radius: 0.5rem;
    object-fit: cover;
}

.subcategory-icon-label {
    font-size: 0.75rem;
    margin-top: 0.5rem;
    color: #4a5568;
    line-height: 1.2;
}

/* ---  Modal References Accordion --- */
.modal-references {
    margin-top: 1.5rem;
    border-top: 1px solid #e2e8f0;
    padding-top: 1.5rem;
}

.modal-references details {
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
}

.modal-references summary {
    font-weight: 600;
    padding: 0.75rem 1rem;
    cursor: pointer;
    list-style: none; /* Remove default arrow in some browsers */
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-references summary::-webkit-details-marker {
    display: none; /* Remove default arrow in Chrome/Safari */
}

.modal-references summary::after {
    content: '▼';
    font-size: 0.8em;
    transition: transform 0.2s ease;
}

.modal-references details[open] > summary::after {
    transform: rotate(180deg);
}

.modal-references-content {
    padding: 0 1rem 1rem 1rem;
    font-size: 0.875rem;
    line-height: 1.5;
    word-break: break-all; /* Helps long URLs wrap */
}

.modal-references-content ul {
    list-style-type: disc;
    padding-left: 1.5rem;
    margin: 0;
}

.modal-references-content li {
    margin-bottom: 0.5rem;
}

/* --- App Header Styles --- */
.app-header {
    position: relative;
    display: flex
;
    align-items: center;
    justify-content: space-between;
    min-height: 120px;
    padding: 0 1.5rem;
    margin-left: -3rem;
    margin-right: -3rem;
    background-image: url(https://smart-networks.europa.eu/wp-content/uploads/2025/09/6gsns-landing-page-banner-06.jpg);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    /* border-radius: 0.75rem; */
}

.header-back-link {
    /* Shape and Color */
    background: white;               /* White background */
    color: black;                    /* Black text */
    padding: 0.5rem 1.25rem;         /* Adds spacing inside the pill */
    border-radius: 9999px;           /* This creates the pill shape */

    /* Font and Other Styles */
    font-weight: 600;
    text-decoration: none;
    transition: background-color 0.2s ease, color 0.2s ease;
	margin-bottom: 1rem
}
.header-back-link:hover {
    background-color: #f0f0f0; 
}

.header-logo-link {
    /* This is the technique to perfectly center the logo */
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}



/* --- Landing Page View Styles --- */
.landing-view {
    text-align: center;
    padding: 2rem 0;
}

.landing-view h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.landing-view p {
    font-size: 1.125rem;
    color: #4a5568;
    max-width: 600px;
    margin: 0 auto 1.5rem auto;
}

.bubble-chart-nav {
    text-align: center;
    margin-bottom: 1rem; /* Reduced from 2rem */
    height: 2rem;
}

.bubble-chart-section {
    background-color: rgba(208, 212, 233, 0.3); /* Same tint as the other section */
    border-radius: 0.75rem;
    padding: 2rem;
    max-width: 1200px;
    margin: 2.5rem auto;
	box-shadow: 5px 10px 15px -3px rgba(0, 0, 0, 0.4), 10px 4px 6px -4px rgba(0, 0, 0, 0.1);

}

.bubble-chart-title {
    text-align: center;
    font-size: 1.75rem;
    margin-top: 0;
    margin-bottom: 0.5rem;
    color: #1a202c;
}

.bubble-chart-subtitle {
    text-align: center;
    max-width: 600px;
    margin: 0 auto 1.5rem auto; /* Center and provide bottom margin */
    color: #4a5568;
}

.chart-container {
    max-width: 900px;
    margin: 0 auto 2.5rem auto;
	height:450px
}

.explore-button {
    background-color: #292459;
    color: white;
    border: none;
    border-radius: 9999px;
    padding: 1rem 2.5rem;
    font-size: 1.125rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease;
	/*margin-bottom: 2.5rem;*/
}

.explore-button:hover {
    background-color: #1a202c;
    transform: translateY(-2px);
}
/* --- Chart Toggle Button Styles --- */
.chart-toggle-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.5rem;
}

.chart-toggle-button {
    background-color: #f1f5f9;
    color: #4a5568;
    border: 1px solid #e2e8f0;
    border-radius: 9999px;
    padding: 0.5rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.chart-toggle-button:hover {
    background-color: #e2e8f0;
}

.chart-toggle-button.active {
    background-color: #292459;
    color: white;
    border-color: #2d3748;
}

/* --- NEW: Split Landing Page Layout --- */
.intro-section {
    max-width: 1300px;
    margin: 1rem auto 2.5rem auto;
    display: grid;
    grid-template-columns: 3fr 1fr; /* <-- Changed from 2fr 1fr */
    gap: 2rem;
    align-items: center;
}

.intro-text h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    margin-top: 0;
    
}

.intro-text p {
    font-size: 1rem;
    line-height: 1.6;
    color: #4a5568;
    max-width: 90%;
	text-align: left; /* <-- Added this */
    margin-bottom: 1rem; /* <-- Added this for spacing */
}

.intro-text .category-list {
    list-style: decimal; /* Use 1, 2, 3 numbering */
    padding-left: 2rem;  /* Indent the list */
    margin: 1rem 0;
    text-align: left;
    max-width: 90%;
	list-style-position: inside;
}

.intro-text .category-list li {
    font-size: 1rem;
    line-height: 1.6;
    color: #4a5568;
    margin-bottom: 0.5rem; /* Space between list items */
}

.main-stats-container {
    display: flex;
    gap: 2rem;
    justify-content: center;
    padding: 1rem 0;
}

/* 1. Default styles for desktops and large screens */
.main-stat-item {
    width: 200px;
    height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-color: #292459;
    border-radius: 50%;
    border: 4px solid #fff;
    box-shadow: inset 0 4px 6px rgba(0, 0, 0, 0.2), 
                0 8px 15px rgba(0, 0, 0, 0.1);
    transition: width 0.3s ease, height 0.3s ease; /* Smoothly animate size changes */
}

.main-stat-number {
    color: #fff;
    font-size: 3.5rem;
    font-weight: 700;
    transition: font-size 0.3s ease; /* Smoothly animate font size changes */
}

.main-stat-label {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.3rem;
    margin-top: 1rem;
    transition: font-size 0.3s ease; /* Smoothly animate font size changes */
}

/* 2. Styles for tablets and smaller screens (768px and below) */
@media (max-width: 768px) {
    .main-stat-item {
        width: 180px;
        height: 180px;
    }

    .main-stat-number {
        font-size: 3.25rem;
    }

    .main-stat-label {
        font-size: 1.1rem;
        margin-top: 0.75rem;
    }
}

/* 3. Styles for mobile phones (480px and below) */
@media (max-width: 480px) {
    .main-stat-item {
        width: 150px;
        height: 150px;
    }

    .main-stat-number {
        font-size: 3rem;
    }

    .main-stat-label {
        font-size: 1rem;
        margin-top: 0.5rem;
    }
}
/* Category Grid Section */
.category-grid-section {
    background-color: rgba(208, 212, 233, 0.3);
    border-radius: 0.75rem;
    padding: 2rem;
    max-width: 1200px;
    margin: 2.5rem auto;
	box-shadow: 5px 10px 15px -3px rgba(0, 0, 0, 0.4), 10px 4px 6px -4px rgba(0, 0, 0, 0.1);

}

.category-grid-title {
    text-align: center;
    font-size: 1.75rem;
    margin-top: 0;
    margin-bottom: 2rem;
    color: #1a202c;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1.5rem;
}


/* This styles the main colored card container */
.category-grid-item {
    border-radius: 0.5rem;
    padding: 1.5rem 1rem;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 1px 3px rgba(0,0,0,0.03), 0 1px 2px rgba(0,0,0,0.06);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
	display: flex;
    flex-direction: column;
    cursor: pointer;
}

.category-grid-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.07), 0 4px 6px -2px rgba(0,0,0,0.05);
}

/* This is the larger (100px) white circle that frames the icon */
.category-icon-wrapper {
    height: 130px;
    width: 130px;
    border-radius: 50%;
    margin: 0 auto 1rem auto;
    background-color: #fff;
    box-shadow: 0 0 8px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* This is the smaller (80px) image inside the wrapper */
.category-icon {
    height: 125px;
    width: 125px;
    border-radius: 50%;
    object-fit: cover;
    display: block; /* <-- Add this line to fix the alignment */
    /* Margin, border, background, and shadow are no longer needed here */
}

/* These rules make the text white and readable on the colored backgrounds */
.category-name {
    font-weight: 600;
    color: #fff;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
    margin-bottom: 0.5rem;
    line-height: 1.3;
	flex-grow: 1;
}

.category-ka-count {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.85);
}

.category-number {
    font-size: 0.75rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    margin-bottom: 0.25rem;
}

/* Responsive adjustments for the intro */
@media (max-width: 768px) {
    .intro-section {
        grid-template-columns: 1fr;
        text-align: center;
    }
    .intro-text p {
        max-width: 100%;
        margin-left: auto;
        margin-right: auto;
    }
}

/* --- NEW: Bubble Chart Styles --- */
.bubble-chart-container {
    position: relative;
    width: 100%;
    max-width: 1200px;
    height: 500px;
    margin: auto;
}

.bubble-chart-svg {
    width: 100%;
    height: 100%;
}

.bubble-node {
    cursor: pointer;
}

.bubble-node circle {
    stroke: #fff;
    stroke-width: 2px;
}

.bubble-tooltip {
    position: absolute;
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    pointer-events: none; /* Allows clicks to go through to the bubble */
    opacity: 0;
    transition: opacity 0.2s ease;
    text-align: center;
}

.bubble-chart-nav {
    text-align: center;
    margin-bottom: 2rem;
}

.bubble-back-button {
    background: none;
    border: none;
    color: #4f46e5;
    font-weight: 600;
    cursor: pointer;
    font-size: 1rem;
    display: none; /* Hidden by default */
}

/* --- NEW: Bubble Chart Stats Row --- */
.bubble-stats-row {
    max-width: 900px;
    margin: 1.5rem auto 1.5rem;
    padding: 1.5rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    display: none;
    background-color: #d0d4e9;
    opacity: 0;
    transition: opacity 0.4s ease;
    position: relative; /* ADD THIS to become the positioning parent */
}

.bubble-stats-row.is-visible {
    display: grid;
    opacity: 1;
}

.bubble-stat-item {
    text-align: center;
}

.bubble-stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1a202c;
    line-height: 1;
}

.bubble-stat-label {
    font-size: 0.875rem;
    color: #4a5568;
    margin-top: 0.5rem;
}
/* --- NEW: Bubble Stats Header --- */
.bubble-stats-header {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e2e8f0;
}

.bubble-stats-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
}

.bubble-stats-close-btn {
    position: absolute;
    top: 0.75rem;
    right: 0.5rem;
    background: none;
    border: none;
    font-size: 1.75rem;
    line-height: 1;
    cursor: pointer;
    color: #9ca3af;
    padding: 0.5rem;
}

.bubble-stats-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

/* --- NEW: Grid View Stats Bar --- */
.grid-stats-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2rem;
    padding: 1rem;
    margin-bottom: 2rem;
    background-color: #d0d4e9; /* A very light gray */
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
}

.grid-stat-item {
    text-align: center;
}

.grid-stat-number {
    font-size: 1.75rem;
    font-weight: 600;
    color: #1a202c;
    line-height: 1;
}

.grid-stat-label {
    font-size: 0.875rem;
    color: #4a5568;
    margin-top: 0.25rem;
}

/* --- NEW: Top 10 Button Styles --- */
.top-achievements-button {
    /* Shape, Spacing, and Font */
    display: inline-block;
    background-color: #f59e0b; /* A vibrant yellow/orange color */
    color: #1a202c; /* Dark text for contrast */
    border: none;
    border-radius: 9999px;
    padding: 1rem 2.5rem;
    /*margin-bottom: 1rem;*/
    font-family: inherit; /* Ensures the button uses the page font */
    font-size: 1.125rem;
    font-weight: 600;
    cursor: pointer;

    /* Animation and Transitions */
    animation: glow 2s infinite ease-in-out;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.top-achievements-button:hover {
    background-color: #fbbd23; /* A slightly lighter yellow on hover */
    transform: translateY(-2px);
    animation-play-state: paused;
}
.top-achievements-button.active {
    background-color: #fbbd23;
    animation-play-state: paused;
    box-shadow: 0 0 0 3px white, 0 0 0 5px #f59e0b;
}

/* The glowing animation keyframes */
@keyframes glow {
    0% {
        box-shadow: 0 0 5px rgba(245, 158, 11, 0.5);
    }
    50% {
        box-shadow: 0 0 20px rgba(245, 158, 11, 0.8);
    }
    100% {
        box-shadow: 0 0 5px rgba(245, 158, 11, 0.5);
    }
}

.landing-button-container {
    display: flex;
    justify-content: center; /* Horizontally centers the buttons */
    align-items: center;    /* Vertically aligns them perfectly */
    gap: 1.5rem;              /* Creates space between the buttons */
    margin-bottom: 2.5rem;  /* Adds space below the button group */
    flex-wrap: wrap;        /* Allows buttons to stack on very small screens */
}



/* --- NEW: Bubble Stats Explore Button --- */
.explore-button-container {
    display: flex;
    align-items: center;
    justify-content: center;
    /* This helps vertically align the button with the other stat items */
    padding-top: 1rem; 
}

.explore-subcategory-button {
    background-color: #292459; /* Matches main explore button */
    color: white;
    border: none;
    border-radius: 9999px; /* Pill shape */
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.explore-subcategory-button:hover {
    background-color: #1a202c;
    transform: translateY(-2px);
}


/* --- NEW: Chart Section Styles for Custom Accordion --- */
.chart-section {
    background-color: rgba(208, 212, 233, 0.3);
    border-radius: 0.75rem;
    padding: 2rem;
    max-width: 1200px;
    margin: 2.5rem auto;
    box-shadow: 5px 10px 15px -3px rgba(0, 0, 0, 0.4), 10px 4px 6px -4px rgba(0, 0, 0, 0.1);
}

.chart-section-title {
    text-align: center;
    font-size: 1.75rem;
    color: #1a202c;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    margin: 0; /* Removes default h2 margin */
}

/* Custom dropdown arrow */
.chart-section-title::after {
    content: '▼';
    font-size: 0.8em;
    transition: transform 0.3s ease;
}

/* Rotate arrow when open */
.chart-section.is-open .chart-section-title::after {
    transform: rotate(180deg);
}

/* Content area is hidden by default */
.chart-section-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease-out, margin-top 0.5s ease-out;
}

/* When open, content area expands */
.chart-section.is-open .chart-section-content {
    max-height: 1000px; /* A large value to allow for content */
    margin-top: 2rem;
}

.chart-section-subtitle {
    text-align: center;
    max-width: 600px;
    margin: 0 auto 1.5rem auto;
    color: #4a5568;
}

.bubble-chart-subtitle {
    text-align: center;
    max-width: 600px;
    margin: 0 auto 1.5rem auto; /* Center and provide bottom margin */
    color: #4a5568;
}

/* --- START: Added this new section for mobile spacing --- */
@media (max-width: 768px) {
    .bubble-chart-section {
        padding: 1.5rem 1rem; /* Reduce top/bottom padding */
        margin: 1.5rem auto; /* Reduce top/bottom margin */
    }

    .bubble-chart-container {
        height: 350px; /* Reduce the fixed height on smaller screens */
    }
}

.header-logo-img {
    display: block; /* Removes extra space below the image */
    max-height: 120px; /* Control the logo size */
    width: auto;
}

/* --- START: Added this new section for mobile header --- */
@media (max-width: 768px) {
    .app-header {
        flex-direction: column; /* Stack items vertically */
        justify-content: center;  /* Center the items */
        padding: 1.5rem 0;        /* Add vertical spacing */
        min-height: auto;         /* Allow the height to adjust */
    }

    .header-logo-link {
        position: static; /* Remove the absolute positioning */
        transform: none;    /* Reset the transform property */
        margin-bottom: 1rem; /* Add space below the logo */
    }

    .header-back-link {
        margin-bottom: 0; /* Remove any bottom margin on the button */
    }
}
