/* CSS Variables */
:root {
    --dark-color: #0B0519;
    --light-beige: #F6F4F2;
    --navy-color: #1C2A4A;
    --black-color: #000000;
}

/* Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Body */
body {
    width: 100%;
    background-color: var(--light-beige);
    font-family: 'Lato', sans-serif;
    color: var(--black-color);
    overflow-x: hidden;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Boldonse', sans-serif;
    font-weight: 700;
}

h2 {
    font-size: 2.5rem;
}

/* Header */
header {
    width: 100%;
}

.navbar {
    background-color: var(--light-beige) !important;
    padding: 1rem 2rem;
}

.navbar-dark .navbar-nav .nav-link {
    color: var(--black-color) !important;
    font-family: 'Lato', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
}

.navbar-dark .navbar-toggler {
    border-color: var(--black-color) !important;
}

.logo img {
    height: 50px;
    width: auto;
}

/* Hero Section */
.hero {
    background-color: var(--navy-color);
    text-align: center;
    padding: 3rem 0;
    margin-bottom: 3rem;
    width: 100%;
}

.hero h1 {
    color: #fff;
    font-size: 3rem;
    text-transform: uppercase;
}

/* Main Content */
main {
    width: 100%;
    max-width: 1800px;
    margin: 0 auto;
    padding: 2rem;
    text-align: center;
}

section {
    padding: 3rem 0;
    width: 100%;
    margin: 5rem 0;
}

/* Box Component */
.box-container {
    position: relative;
    display: inline-block;
    margin-bottom: 2rem;
}

.box-beige {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 100%;
    height: 100%;
    background-color: var(--light-beige);
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    z-index: 1;
}

.box-darkblue {
    position: relative;
    width: fit-content;
    padding: 1rem 2rem;
    background-color: var(--navy-color);
    color: #fff;
    border-radius: 8px;
    z-index: 2;
}

.box-darkblue h2 {
    color: #fff;
    margin: 0;
}

.box-container.in-view .box-beige,
.box-container.in-view .box-darkblue {
    transform: translate(0, 0);
    opacity: 1;
    transition: transform 0.5s ease-out, opacity 0.5s ease-out;
}

.box-container:not(.in-view) .box-beige {
    transform: translate(-30px, 30px);
    opacity: 0;
}

.box-container:not(.in-view) .box-darkblue {
    transform: translate(30px, -30px);
    opacity: 0;
}

/* About Section */
#about {
    text-align: center;
    margin-top: 3rem;
}

#about p {
    max-width: 800px;
    margin: 1rem auto 0;
    line-height: 1.6;
    font-size: 1.1rem;
}

/* Top LCs Section */
#top-lcs {
    text-align: center;
}

.top-lcs-cards {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.lc-card {
    background-color: var(--light-beige);
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    padding: 1.5rem;
    min-width: 150px;
    text-align: left;
}

.lc-card h3 {
    font-family: 'Boldonse', sans-serif;
    margin-bottom: 1rem;
    font-size: 1.5rem;
    color: var(--navy-color);
}

.lc-card ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.lc-card li {
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 1.1rem;
}

/* Form Elements */
.form-container {
    width: 100%;
    max-width: 800px;
    margin: 0 auto 3rem;
}

.selection-row {
    display: flex;
    justify-content: space-between;
    gap: 2rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.form-group {
    flex: 1;
    min-width: 300px;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-family: 'Boldonse', sans-serif;
    font-size: 1.2rem;
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1rem;
    font-family: 'Lato', sans-serif;
}

/* Buttons */
.submit-btn-container {
    text-align: center;
    margin-top: 2rem;
}

.btn-primary {
    background-color: var(--navy-color);
    border: none;
    padding: 1rem 2rem;
    font-size: 1.2rem;
    font-family: 'Boldonse', sans-serif;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background-color: #0a1e40;
}

/* Numbers & Tables */
.numbers-section {
    margin: 3rem 0;
}

.numbers-section h2,
.conversions-section h2 {
    color: var(--navy-color);
    margin-bottom: 2rem;
    text-align: center;
}

.table-box {
    overflow-x: auto;
    background-color: #fff;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.numbers-table,
.conversions-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

.numbers-table th,
.conversions-table th,
.numbers-table td,
.conversions-table td {
    padding: 1rem;
    text-align: center;
    border: 1px solid #ddd;
}

.numbers-table th,
.conversions-table th {
    background-color: var(--navy-color);
    color: #fff;
    font-family: 'Boldonse', sans-serif;
}

/* Last Year Comparison Section */
#last-year-comparison {
    text-align: center;
    margin: 6rem 0;
}

.lyc-charts {
    display: flex;
    flex-direction: column;
    gap: 3rem;
    max-width: 1000px;
    margin: 0 auto;
}

.chart-wrapper {
    position: relative;
    width: 100%;
    height: 400px;
    margin: 0 auto;
    background-color: #fff;
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

/* LC SHARE Section */
#lc-share {
    text-align: center;
    margin: 6rem 0;
}

.share-charts {
    display: flex;
    justify-content: center;
    gap: 3rem;
    max-width: 800px;
    margin: 0 auto;
    flex-wrap: wrap;
}

.share-chart {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    min-width: 250px;
}

.share-chart .chart-wrapper {
    width: 300px;
    height: 300px;
    margin-bottom: 1rem;
    background-color: #fff;
}

.share-chart .total-number {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 1rem;
    font-family: 'Boldonse', sans-serif;
}

.share-chart .legend {
    list-style: none;
    padding: 0;
    margin: 0;
    text-align: left;
}

.share-chart .legend li {
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    font-family: 'Lato', sans-serif;
    font-size: 1.1rem;
}

.share-chart .legend .dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 0.5rem;
}

.dot-ogv { background-color: orange; }
.dot-ogta { background-color: green; }
.dot-ogte { background-color: red; }
.dot-total { background-color: blue; }

/* Counter Section */
#counter {
    text-align: center;
    margin: 6rem 0;
}

.counter-cards {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 2rem;
}

.counter-card {
    background-color: var(--light-beige);
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    padding: 1.5rem;
    min-width: 120px;
    text-align: center;
}

.counter-card h3 {
    font-family: 'Boldonse', sans-serif;
    font-size: 1.5rem;
    color: var(--navy-color);
    margin-bottom: 1rem;
}

.counter-number {
    font-family: 'Boldonse', sans-serif;
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--navy-color);
}

.counter-date {
    margin-top: 2rem;
    font-size: 1.2rem;
    color: var(--navy-color);
    font-family: 'Lato', sans-serif;
}

/* Export Section removed */

/* Contact Us Section */
#contact-us {
    margin: 0;
    padding: 0;
    width: 100%;
}

.contact-hero {
    background-color: var(--navy-color);
    text-align: center;
    padding: 4rem 0;
    width: 100vw; /* full viewport width */
    margin-left: calc(50% - 50vw); /* extend beyond centered parent constraints */
}

.contact-hero .hero-text {
    font-size: 3.5rem;
    line-height: 1.2;
    color: #fff; /* Changed from black to white */
}

.master-decisions,
.stand-unshaken {
    font-family: 'Boldonse', sans-serif;
    font-weight: 700;
    display: inline-block;
}

.contact-lower {
    background-color: transparent; /* Changed from navy to transparent */
    display: flex;
    align-items: center;
    justify-content: space-evenly;
    padding: 2rem 0; /* Reduced padding */
    flex-wrap: wrap;
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
}

.contact-left p {
    display: none;
}

.contact-left p {
    font-family: 'Boldonse', sans-serif;
    font-size: 2rem;
    color: #fff;
    margin-bottom: 1rem;
    text-transform: uppercase;
}

.contact-left img {
    width: 150px;
    height: auto;
}

.contact-right {
    display: flex;
    flex-direction: row; /* Changed from column to row */
    gap: 1.5rem;
    margin-top: 1rem;
}

.contact-right a img {
    width: 50px;
    height: 50px;
    transition: opacity 0.3s ease;
    filter: brightness(0) invert(1);
}

.contact-right a img:hover {
    opacity: 0.7;
}

/* LC Ranking Sections */
#dynamic-lc-ranking,
#fixed-lc-ranking {
    text-align: center;
    margin: 6rem 0;
    overflow-x: auto;
}

.ranking-table-container {
    width: 100%;
    overflow-x: auto;
}

.ranking-tables {
    margin-top: 2rem;
}

.ranking-table-section {
    margin-bottom: 3rem;
    background-color: rgba(255, 255, 255, 0.8);
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.ranking-table-section h3 {
    font-family: 'Boldonse', sans-serif;
    color: var(--navy-color);
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
}

.ranking-table {
    margin-top: 1rem;
    background-color: white;
}

.ranking-table th {
    background-color: var(--navy-color);
    color: white;
    font-weight: 600;
    text-align: center;
    padding: 1rem;
}

.ranking-table td {
    text-align: center;
    padding: 0.75rem;
    vertical-align: middle;
}

.ranking-table tbody tr:nth-child(1) {
    background-color: #ffd700;
    font-weight: bold;
}

.ranking-table tbody tr:nth-child(2) {
    background-color: #c0c0c0;
    font-weight: bold;
}

.ranking-table tbody tr:nth-child(3) {
    background-color: #cd7f32;
    font-weight: bold;
}

.ranking-table tbody tr:hover {
    background-color: rgba(0, 123, 255, 0.1);
}

/* Fixed ranking section specific styling */
#fixed-lc-ranking .box-darkblue h2 {
    font-size: 1.8rem;
}

#fixed-lc-ranking .ranking-table-section {
    border-left: 4px solid var(--navy-color);
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2rem;
    }
    
    .contact-hero .hero-text {
        font-size: 2.5rem;
    }
    
    .selection-row {
        flex-direction: column;
        gap: 1rem;
    }
    
    .form-group {
        min-width: 100%;
    }
    
    .chart-wrapper {
        height: 300px;
    }
    
    .contact-left p {
        font-size: 1.5rem;
    }
    
    .contact-left img {
        width: 100px;
    }
    
    .contact-right a img {
        width: 40px;
        height: 40px;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 1.5rem;
    }
    
    .contact-hero .hero-text {
        font-size: 2rem;
    }
    
    #export button {
        font-size: 1.5rem;
        padding: 0.8rem 1.5rem;
    }
    
    .contact-left p {
        font-size: 1.2rem;
    }
    
    .contact-left img {
        width: 80px;
    }
}

/* Analysis Section Styles */
#analysis-section {
    margin: 3rem 0;
    padding: 2rem;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

#analysis-section .nav-tabs {
    border-bottom: 2px solid var(--navy-color);
    margin-bottom: 2rem;
}

#analysis-section .nav-tabs .nav-link {
    border: none;
    color: var(--black-color);
    font-weight: 600;
    padding: 1rem 2rem;
    margin-right: 0.5rem;
    border-radius: 8px 8px 0 0;
    background-color: var(--light-beige);
}

#analysis-section .nav-tabs .nav-link.active {
    background-color: var(--navy-color);
    color: #fff;
    border-bottom: 2px solid var(--navy-color);
}

#analysis-section .nav-tabs .nav-link:hover {
    background-color: #e8e6e3;
}

#analysis-section .nav-tabs .nav-link.active:hover {
    background-color: var(--navy-color);
}

/* Table styles for analysis sections */
#analysis-section .table-responsive {
    margin-top: 1rem;
}

#analysis-section .table {
    background-color: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

#analysis-section .table thead th {
    background-color: var(--navy-color);
    color: #fff;
    border: none;
    padding: 1rem;
    font-weight: 600;
}

#analysis-section .table tbody td {
    padding: 1rem;
    border-bottom: 1px solid #e9ecef;
}

#analysis-section .table tbody tr:hover {
    background-color: #f8f9fa;
}

/* Form controls in analysis section */
#analysis-section .form-control {
    border: 2px solid #e9ecef;
    border-radius: 6px;
    padding: 0.75rem;
    font-size: 1rem;
}

#analysis-section .form-control:focus {
    border-color: var(--navy-color);
    box-shadow: 0 0 0 0.2rem rgba(28, 42, 74, 0.25);
}

#analysis-section .btn-primary {
    background-color: var(--navy-color);
    border-color: var(--navy-color);
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    border-radius: 6px;
}

#analysis-section .btn-primary:hover {
    background-color: #152238;
    border-color: #152238;
}

/* Product KPIs Section */
.product-kpi-cards {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 2rem;
    margin-top: 2rem;
}

.product-card {
    background-color: var(--light-beige);
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    text-align: center;
    flex: 1;
    min-width: 300px;
}

.product-card h3 {
    color: var(--navy-color);
    font-size: 2rem;
    margin-bottom: 1.5rem;
}

.product-card .counter-cards {
    justify-content: center;
}

.product-card h4 {
    font-family: 'Lato', sans-serif;
    color: var(--navy-color);
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.product-card p {
    font-family: 'Boldonse', sans-serif;
    font-size: 2.5rem;
    color: var(--dark-color);
    margin: 0;
}

/* Enhanced Ranking Tables Grid Layout */
.ranking-tables-grid {
    width: 100%;
    max-width: 1800px;
    margin: 0 auto;
    padding: 0 20px;
    box-sizing: border-box;
}

.ranking-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 24px;
    margin-bottom: 30px;
}

.ranking-table-section {
    width: 100%;
    min-width: 0; /* Prevent overflow */
}

.ranking-card {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.07);
    border: 1px solid #e9ecef;
    overflow: hidden;
    transition: box-shadow 0.2s;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.ranking-card:hover {
    box-shadow: 0 6px 24px rgba(0,0,0,0.12);
}

.ranking-header {
    background: #f8f9fa;
    color: #1C2A4A;
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    border-bottom: 1px solid #e9ecef;
}

.ranking-header h3 {
    margin: 0;
    font-size: 1.08rem;
    font-weight: 600;
    color: #1C2A4A;
    flex: 1;
    letter-spacing: 0.01em;
}

.ranking-card .table-responsive {
    flex: 1;
    padding: 1rem 1.25rem 1.25rem 1.25rem;
}

.ranking-table {
    margin: 0;
    border: none;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: none;
    background: #fff;
}

.ranking-table thead th {
    background: #f1f3f6;
    color: #1C2A4A;
    border: none;
    padding: 0.85rem 0.75rem;
    font-weight: 600;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ranking-table tbody td {
    padding: 0.75rem 0.75rem;
    border: none;
    border-bottom: 1px solid #f1f3f6;
    font-size: 0.97rem;
    vertical-align: middle;
    background: #fff;
}

.ranking-table tbody tr:last-child td {
    border-bottom: none;
}

.ranking-table tbody tr {
    background: #fff;
    font-weight: 400;
    transition: background 0.2s;
}

.ranking-table tbody tr:hover {
    background: #f8f9fa;
    transform: none;
}

/* Remove medal emojis */
.ranking-table tbody tr td:first-child::before {
    content: '';
    margin-right: 0;
}

/* Form and button clean-up */
.form-container {
    background: #fff;
    border-radius: 14px;
    padding: 1.5rem 2rem;
    margin-bottom: 2.5rem;
    box-shadow: 0 2px 12px rgba(0,0,0,0.07);
    border: 1px solid #e9ecef;
}

/* Ensure dynamic ranking filter is always clickable and above decorative boxes */
#dynamic-lc-ranking .form-container {
    position: relative;
    z-index: 5;
}

.selection-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.2rem;
    align-items: end;
}

.form-group label {
    font-weight: 600;
    color: #1C2A4A;
    margin-bottom: 0.5rem;
    font-size: 0.93rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-control {
    border: 1.5px solid #e9ecef;
    border-radius: 8px;
    padding: 0.7rem 1rem;
    font-size: 0.97rem;
    background: #fff;
    transition: border-color 0.2s;
}

.form-control:focus {
    border-color: #1C2A4A;
    box-shadow: 0 0 0 0.1rem rgba(28, 42, 74, 0.08);
    outline: none;
}

.btn-primary {
    background: #1C2A4A;
    border: none;
    border-radius: 8px;
    padding: 0.8rem 2rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: background 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 8px rgba(28, 42, 74, 0.08);
}

.btn-primary:hover {
    background: #152238;
    box-shadow: 0 4px 16px rgba(28, 42, 74, 0.13);
}

/* Loading animation */
.ranking-table tbody tr td[colspan] {
    text-align: center;
    padding: 2rem;
    color: #6c757d;
    font-style: italic;
    position: relative;
    background: #fff;
}

.ranking-table tbody tr td[colspan]:not(:empty)::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #e9ecef;
    border-radius: 50%;
    border-top-color: #1C2A4A;
    animation: spin 1s ease-in-out infinite;
    margin-left: 0.5rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

#fixed-lc-ranking,
#dynamic-lc-ranking {
    margin: 3rem 0;
}

#fixed-lc-ranking .box-darkblue h2,
#dynamic-lc-ranking .box-darkblue h2 {
    font-size: 1.7rem;
    margin-bottom: 0;
}

#fixed-lc-ranking .box-container,
#dynamic-lc-ranking .box-container {
    margin-bottom: 2.5rem;
}

@media (max-width: 800px) {
    .ranking-row {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .ranking-table-section {
        min-width: 100%;
    }
}

/* For larger screens, ensure proper 2-column layout for 4-table and 6-table sections */
@media (min-width: 1200px) {
    .ranking-row {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* For very large screens, allow 3 columns */
@media (min-width: 1600px) {
    .ranking-row {
        grid-template-columns: repeat(3, 1fr);
    }
}