/* Google Fonts Import */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600;700;800;900&display=swap');

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

body {
    background: linear-gradient(135deg, #0a0e27 0%, #000000 50%, #0a0e27 100%);
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #ffffff;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 20% 80%, rgba(0, 123, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 0, 123, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(123, 0, 255, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.container {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    padding: 30px 20px;
    position: relative;
    z-index: 1;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
}

.header {
    text-align: center;
    margin-bottom: 3rem;
    animation: fadeInDown 0.8s ease-out;
}

.title {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #ffffff 0%, #e0e0e0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 30px rgba(255, 255, 255, 0.1);
    letter-spacing: -0.02em;
}

.subtitle {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 300;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.controls-card {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 25px;
    margin-bottom: 2rem;
    box-shadow: 
        0 10px 40px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

.controls {
    display: flex;
    gap: 1.2rem;
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-start;
}

/* Desktop optimization - prevent wrapping */
@media (min-width: 992px) {
    .controls {
        flex-wrap: nowrap;
        gap: 1rem;
    }
    
    .select-input {
        min-width: 130px;
        font-size: 0.9rem;
    }
}

.dropdown-group {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.dropdown-group label {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.select-input {
    background: rgba(255, 255, 255, 0.05);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    outline: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 140px;
    backdrop-filter: blur(5px);
}

.select-input:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.select-input:focus {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1);
}

option {
    background-color: #1a1a1a;
    color: white;
    padding: 8px;
}

.main-display-card {
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 30px;
    padding: 3rem 2rem;
    margin-bottom: 2rem;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        inset 0 -1px 0 rgba(0, 0, 0, 0.3);
    animation: fadeInUp 0.8s ease-out 0.4s both;
    position: relative;
    overflow: hidden;
}

.main-display-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.05), transparent);
    animation: shimmer 3s infinite;
}

.debt-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.debt-label {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 600;
}

.debt-amount {
    font-family: 'JetBrains Mono', monospace;
    font-size: 100px;
    font-weight: 600;
    text-align: center;
    color: #FF0000;
    text-shadow: 
        0 0 30px currentColor,
        0 0 60px rgba(255, 0, 0, 0.4);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    word-break: keep-all;
    white-space: nowrap;
    line-height: 1;
    max-width: 95vw;
    overflow: hidden;
    position: relative;
}

.update-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.85rem;
}

.pulse {
    width: 8px;
    height: 8px;
    background: #00ff00;
    border-radius: 50%;
    animation: pulse-animation 2s infinite;
    box-shadow: 0 0 10px #00ff00;
}

.update-text {
    font-weight: 500;
    letter-spacing: 0.05em;
}

/* Fun Facts Section - Standalone Container */
.fun-fact-section {
    width: 100%;
    max-width: 1200px;
    margin: 2rem auto;
    padding: 20px;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    border-left: 4px solid #4834d4;
    box-shadow: 
        0 10px 40px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    animation: fadeInUp 0.8s ease-out 0.5s both;
}

.section-header {
    margin-bottom: 15px;
    text-align: center;
}

.section-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.fun-fact-text {
    font-style: italic;
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.5;
    text-align: center;
    min-height: 25px;
    padding: 10px;
}

.fact-loading {
    color: rgba(255, 255, 255, 0.6);
    animation: fade-pulse 2s infinite;
}

@keyframes fade-pulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

.error-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 3rem;
    color: rgba(255, 255, 255, 0.5);
    font-size: 1.2rem;
    text-align: center;
    font-weight: 400;
}

.error-icon {
    opacity: 0.5;
    animation: pulse-animation 2s infinite;
}

.chart-container {
    width: 100%;
    margin: 2rem auto;
    padding: 30px;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    box-shadow: 
        0 10px 40px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.chart-container:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 15px 50px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.chart-header h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
    margin: 0;
}

.chart-period {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 500;
}

canvas {
    width: 100% !important;
    height: 400px !important;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.3));
}

/* Footer Styles */
.footer {
    margin-top: 3rem;
    width: 100%;
    max-width: 1200px;
}

.stats-row {
    display: flex;
    justify-content: space-around;
    gap: 2rem;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    margin-bottom: 2rem;
    animation: fadeInUp 0.8s ease-out 0.8s both;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.stat-label {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.stat-value {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
}

/* Ad Container */
.ad-container {
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 1rem; /* Reduced padding to give more space */
    margin-top: 2rem;
    animation: fadeInUp 0.8s ease-out 1s both;
    width: 100%;
    max-width: none;
    box-sizing: border-box;
}

.ad-label {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
    text-align: center;
}

.ad-space {
    min-height: 250px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    display: block;
    border: 1px dashed rgba(255, 255, 255, 0.1);
    padding: 0; /* Remove padding that constrains width */
    width: 100%;
    box-sizing: border-box;
}

/* Native ads styling */
.native-ad-space {
    min-height: 300px; /* Native ads typically need more height */
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#adsterra-native-container,
#adsterra-native-container-top,
#yllixads-native-container,
#propellerads-container {
    width: 100%;
    max-width: 100%;
    text-align: center;
    overflow: hidden;
}

/* Native ad placeholder styling */
.native-ad-placeholder {
    width: 100%;
    min-height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.02);
}

/* Hide placeholder when actual ad loads */
#adsterra-native-container:has(script) .native-ad-placeholder,
#adsterra-native-container-top:has(script) .native-ad-placeholder,
#yllixads-native-container:has(script) .native-ad-placeholder,
#propellerads-container:has(script) .native-ad-placeholder {
    display: none;
}

/* Footer placeholder specific styling */
.footer-placeholder {
    border-color: rgba(255, 255, 255, 0.15);
    background: rgba(0, 255, 100, 0.02);
}

/* Native ad responsive adjustments */
@media (max-width: 768px) {
    .native-ad-space {
        min-height: 280px;
        padding: 8px;
    }
    
    .native-ad-placeholder {
        min-height: 230px;
    }
}

@media (max-width: 480px) {
    .native-ad-space {
        min-height: 250px;
        padding: 5px;
    }
    
    .native-ad-placeholder {
        min-height: 200px;
    }
}

/* Ensure AdSense ads display properly */
.adsbygoogle {
    display: block !important;
    width: 100% !important;
    min-height: 100px;
    max-width: 100%;
    margin: 0 !important;
    padding: 10px;
    box-sizing: border-box;
    min-width: 320px; /* Ensure minimum width for ads */
}

/* Responsive ad handling */
@media (max-width: 480px) {
    .adsbygoogle {
        min-width: 280px;
        padding: 5px;
    }
    
    .ad-container {
        padding: 0.5rem;
    }
    
    .ad-space {
        padding: 0;
    }
}

/* Cookie Consent Banner */
.cookie-consent-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 20px;
    z-index: 10000;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
}

.cookie-consent-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.cookie-consent-text {
    flex: 1;
    min-width: 300px;
}

.cookie-consent-text h3 {
    color: #ffffff;
    font-size: 1.1rem;
    margin-bottom: 8px;
    font-weight: 600;
}

.cookie-consent-text p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    line-height: 1.4;
    margin: 0;
}

.cookie-consent-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.consent-btn {
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    white-space: nowrap;
}

.consent-btn-accept {
    background: #4834d4;
    color: white;
}

.consent-btn-accept:hover {
    background: #3742fa;
    transform: translateY(-1px);
}

.consent-btn-reject {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.consent-btn-reject:hover {
    background: rgba(255, 255, 255, 0.15);
}

.consent-btn-settings {
    background: transparent;
    color: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.consent-btn-settings:hover {
    color: rgba(255, 255, 255, 0.9);
    border-color: rgba(255, 255, 255, 0.4);
}

.privacy-link-consent {
    color: rgba(255, 255, 255, 0.6);
    text-decoration: underline;
    font-size: 0.85rem;
    margin-left: 10px;
}

.privacy-link-consent:hover {
    color: rgba(255, 255, 255, 0.9);
}

/* Cookie Settings Modal */
.cookie-category {
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.cookie-category h4 {
    color: #ffffff;
    margin-bottom: 8px;
    font-size: 1rem;
}

.cookie-category p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    margin-bottom: 10px;
    line-height: 1.4;
}

/* Cookie Toggle Switch */
.cookie-toggle {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.cookie-toggle input[type="checkbox"] {
    display: none;
}

.toggle-slider {
    position: relative;
    width: 50px;
    height: 24px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 24px;
    transition: background 0.3s ease;
    margin-right: 10px;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s ease;
}

.cookie-toggle input[type="checkbox"]:checked + .toggle-slider {
    background: #4834d4;
}

.cookie-toggle input[type="checkbox"]:checked + .toggle-slider::before {
    transform: translateX(26px);
}

.cookie-toggle input[type="checkbox"]:disabled + .toggle-slider {
    background: rgba(76, 52, 212, 0.5);
    cursor: not-allowed;
}

/* Responsive Cookie Banner */
@media (max-width: 768px) {
    .cookie-consent-content {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .cookie-consent-text {
        min-width: auto;
    }
    
    .cookie-consent-buttons {
        justify-content: center;
        gap: 8px;
    }
    
    .consent-btn {
        padding: 8px 16px;
        font-size: 0.85rem;
    }
    
    .privacy-link-consent {
        margin-left: 0;
        margin-top: 5px;
    }
}

/* Animation Keyframes */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes shimmer {
    0% {
        left: -100%;
    }
    100% {
        left: 200%;
    }
}

@keyframes pulse-animation {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(1.1);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Navigation Menu */
.main-nav {
    background: rgba(0, 0, 0, 0.95);
    border-bottom: 1px solid rgba(72, 52, 212, 0.3);
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 60px;
}

.nav-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 2rem;
}

.nav-menu li {
    margin: 0;
}

.nav-menu a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.nav-menu a:hover {
    color: #fff;
    background: rgba(72, 52, 212, 0.2);
}

.nav-menu a.active {
    color: #4834d4;
    background: rgba(72, 52, 212, 0.1);
}

@media (max-width: 768px) {
    .nav-container {
        padding: 0 1rem;
    }
    
    .nav-brand a {
        font-size: 1.2rem;
    }
    
    .nav-menu {
        gap: 0.5rem;
    }
    
    .nav-menu a {
        padding: 0.5rem 0.7rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .nav-menu {
        gap: 0.2rem;
    }
    
    .nav-menu a {
        padding: 0.4rem 0.5rem;
        font-size: 0.85rem;
    }
}

/* Info Section */
.info-section {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 16px;
    padding: 2rem;
    margin: 2rem auto;
    max-width: 1200px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.info-section h2 {
    color: #4834d4;
    font-size: 1.8rem;
    margin-bottom: 1rem;
    text-align: center;
}

.info-section > p {
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.8;
    text-align: center;
    max-width: 800px;
    margin: 0 auto 2rem;
    font-size: 1.05rem;
}

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

.feature-item {
    background: rgba(72, 52, 212, 0.05);
    border: 1px solid rgba(72, 52, 212, 0.2);
    border-radius: 12px;
    padding: 1.5rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.feature-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(72, 52, 212, 0.2);
}

.feature-item h3 {
    color: rgba(255, 255, 255, 0.95);
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.feature-item p {
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.6;
    font-size: 0.95rem;
}

@media (max-width: 768px) {
    .info-section {
        padding: 1.5rem;
    }
    
    .info-section h2 {
        font-size: 1.5rem;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
}

/* Loading States */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    backdrop-filter: blur(4px);
    z-index: 10;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.loading-overlay.active {
    opacity: 1;
    visibility: visible;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(72, 52, 212, 0.3);
    border-top: 4px solid #4834d4;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

.loading-text {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.95rem;
    font-weight: 600;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes pulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

.chart-container.loading {
    position: relative;
}

/* Country Selector for Charts */
.country-selector {
    margin: 1.5rem 0;
    padding: 1.5rem;
    background: rgba(72, 52, 212, 0.1);
    border-radius: 12px;
    border: 2px solid rgba(72, 52, 212, 0.3);
    box-shadow: 0 4px 20px rgba(72, 52, 212, 0.2);
}

.country-selector > label {
    display: block;
    color: rgba(255, 255, 255, 0.95);
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.country-checkboxes {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.5rem;
    margin-bottom: 1rem;
    max-height: 200px;
    overflow-y: auto;
    padding: 0.5rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: background 0.2s ease;
}

.checkbox-item:hover {
    background: rgba(72, 52, 212, 0.1);
}

.checkbox-item input[type="checkbox"] {
    margin-right: 0.5rem;
    cursor: pointer;
}

.update-btn {
    background: linear-gradient(135deg, #4834d4, #6c63ff);
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 8px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    box-shadow: 0 4px 15px rgba(72, 52, 212, 0.3);
}

.update-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(72, 52, 212, 0.3);
}

.update-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.update-btn.loading {
    position: relative;
    color: transparent;
}

.update-btn.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 2px solid transparent;
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Date Range Controls */
.date-range-controls {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    backdrop-filter: blur(5px);
}

.date-range-controls label {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 12px;
    display: block;
}

.date-selectors {
    display: flex;
    gap: 15px;
    align-items: end;
    flex-wrap: wrap;
}

.date-selector {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.date-selector label {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.year-select {
    background: rgba(255, 255, 255, 0.05);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    outline: none;
    transition: all 0.3s ease;
    min-width: 80px;
    backdrop-filter: blur(5px);
}

.year-select:hover,
.year-select:focus {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
}

.year-select option {
    background: #1a1a1a;
    color: white;
    padding: 8px;
}

@media (max-width: 768px) {
    .date-selectors {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }
    
    .date-selector {
        flex-direction: row;
        align-items: center;
        gap: 10px;
    }
    
    .date-selector label {
        min-width: 50px;
        flex-shrink: 0;
    }
    
    .year-select {
        flex: 1;
    }
}

/* Analytics Section */
.analytics-section {
    width: 100%;
    max-width: 1200px;
    margin: 2rem auto;
    animation: fadeInUp 0.8s ease-out 0.7s both;
}

/* Chart Container Enhancements */
.chart-container {
    position: relative;
    overflow: hidden;
}

.chart-container canvas {
    filter: drop-shadow(0 4px 15px rgba(0, 0, 0, 0.2));
    transition: filter 0.3s ease;
}

.chart-container:hover canvas {
    filter: drop-shadow(0 6px 25px rgba(0, 0, 0, 0.3));
}

.analytics-section .section-header {
    text-align: center;
    margin-bottom: 2rem;
    padding: 20px;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.analytics-section .section-header h2 {
    font-size: 1.8rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.95);
    margin: 0 0 10px 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.section-description {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.7);
    margin: 0;
    font-style: italic;
}

/* Responsive Charts */
.chart-container {
    position: relative;
    max-width: 800px;
    margin: 2rem auto;
    padding: 30px;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

#comparison-container canvas {
    max-width: 100%;
    height: auto !important;
    aspect-ratio: 1.2;
}

@media (max-width: 768px) {
    canvas {
        height: 450px !important; /* Increased from 300px for better readability */
    }
    
    #comparison-container canvas {
        height: auto !important;
        max-width: 350px;
        margin: 0 auto;
        display: block;
    }
    
    .analytics-section .section-header h2 {
        font-size: 1.4rem;
    }
    
    .chart-container {
        padding: 15px; /* Reduced padding to maximize chart area */
        margin: 1.5rem auto;
        max-width: 98%; /* More space for the chart */
    }
    
    .country-checkboxes {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        max-height: 150px;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .title {
        font-size: 2.5rem;
    }
    
    .subtitle {
        font-size: 0.9rem;
    }
    
    .controls {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
        grid-template-areas: 
            "country currency"
            "color analytics";
    }
    
    .dropdown-group:nth-child(1) { grid-area: country; }
    .dropdown-group:nth-child(2) { grid-area: currency; }
    .dropdown-group:nth-child(3) { grid-area: color; }
    .dropdown-group:nth-child(4) { grid-area: analytics; }
    
    .controls-card {
        padding: 20px;
    }
    
    .main-display-card {
        padding: 2rem 1.5rem;
    }
    
    .debt-amount {
        padding: 0 10px;
    }
    
    .select-input {
        min-width: 200px;
        width: 100%;
    }
    
    .stats-row {
        flex-direction: column;
        gap: 1.5rem;
        padding: 1.5rem;
    }
    
    .chart-container {
        padding: 20px;
    }
    
    #debt-chart {
        height: 250px !important;
    }
}

@media (max-width: 480px) {
    .title {
        font-size: 2rem;
    }
    
    .subtitle {
        font-size: 0.8rem;
    }
    
    .debt-amount {
        /* Font size will be handled dynamically by JavaScript */
        word-break: break-all;
        overflow-wrap: break-word;
    }
    
    .error-message {
        font-size: 1rem;
    }
    
    .select-input {
        font-size: 16px; /* Prevents zoom on iOS */
        width: 100%;
    }
    
    .container {
        padding: 10px;
    }
    
    .main-display-card {
        padding: 1.5rem 1rem;
        border-radius: 20px;
    }
    
    .controls-card {
        padding: 15px;
        border-radius: 15px;
    }
    
    .controls {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        grid-template-areas: 
            "country currency"
            "color analytics";
    }
    
    .dropdown-group {
        display: flex;
        flex-direction: column;
        gap: 4px;
        min-width: 0;
    }
    
    .dropdown-group:nth-child(1) { grid-area: country; }
    .dropdown-group:nth-child(2) { grid-area: currency; }
    .dropdown-group:nth-child(3) { grid-area: color; }
    .dropdown-group:nth-child(4) { grid-area: analytics; }
    
    .dropdown-group label {
        font-size: 0.8rem;
        font-weight: 600;
        color: rgba(255, 255, 255, 0.8);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .dropdown-group select {
        font-size: 14px;
        padding: 6px 8px;
        min-width: 0;
        width: 100%;
        box-sizing: border-box;
    }
    
    .control-group select {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .chart-container {
        padding: 10px; /* Reduced further to maximize chart space */
        border-radius: 15px;
    }
    
    #debt-chart {
        height: 350px !important; /* Increased from 200px for better mobile readability */
    }
    
    #comparison-container canvas {
        max-width: 100% !important;
        height: 320px !important; /* Increased from 240px */
    }
    
    .country-checkboxes {
        grid-template-columns: 1fr 1fr;
        max-height: 160px;
        font-size: 0.85rem;
    }
    
    .ad-container {
        padding: 0.75rem;
    }
    
    .ad-space {
        min-height: 150px;
    }

    .banner-ad {
        flex-direction: column;
        text-align: center;
        min-height: 100px;
    }
    
    .banner-ad h4,
    .banner-ad p {
        min-width: auto;
        text-align: center;
    }
    
    /* Date range controls mobile */
    .date-selectors {
        flex-direction: column;
        gap: 10px;
    }
    
    .date-selector {
        display: flex;
        width: 100%;
        align-items: center;
        gap: 10px;
    }
    
    .year-select {
        flex: 1;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .update-btn {
        width: 100%;
        margin-top: 10px;
    }
    
    /* Navigation mobile */
    .nav-menu {
        gap: 0.3rem;
        font-size: 0.8rem;
        padding: 0 10px;
    }
    
    .nav-menu a {
        padding: 0.4rem 0.5rem;
    }
    
    /* Fun facts mobile */
    .fun-fact-section {
        padding: 1rem;
        margin: 1rem 0;
    }
    
    .fun-fact-text {
        font-size: 0.9rem;
    }
    
    /* Features grid mobile */
    .features-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .feature-item {
        padding: 1rem;
    }
    
    .feature-item h3 {
        font-size: 1rem;
    }
    
    .feature-item p {
        font-size: 0.85rem;
    }
}

/* Payment and Modal Styles */
.sample-ad {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.sample-ad h4 {
    margin: 0 0 10px 0;
    font-size: 1.2rem;
}

.sample-ad p {
    margin: 10px 0;
    opacity: 0.9;
    font-size: 0.95rem;
}

.ad-cta {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.ad-cta:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.ad-removal-section {
    margin-top: 20px;
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.remove-ads-btn {
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
}

.remove-ads-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4);
}

.restore-ads-btn {
    background: linear-gradient(135deg, #4834d4, #6c5ce7);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(72, 52, 212, 0.3);
}

.restore-ads-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(72, 52, 212, 0.4);
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.modal-content {
    background: #1a1a1a;
    border-radius: 16px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-header {
    padding: 24px 24px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    color: white;
    margin: 0;
    font-size: 1.4rem;
}

.modal-close {
    background: none;
    border: none;
    color: #888;
    font-size: 28px;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.modal-close:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

.modal-body {
    padding: 24px;
}

.modal-body p {
    color: #ccc;
    margin: 0 0 20px 0;
    line-height: 1.6;
}

.recovery-code-section {
    background: rgba(255, 255, 255, 0.05);
    padding: 20px;
    border-radius: 12px;
    margin: 20px 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.recovery-code {
    background: #000;
    color: #00ff00;
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.2rem;
    font-weight: 600;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    letter-spacing: 2px;
    margin: 15px 0;
    border: 1px solid #333;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.recovery-instructions {
    font-size: 0.9rem;
    color: #888;
    margin: 15px 0 0 0 !important;
}

.recovery-input {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: white;
    font-size: 1rem;
    font-family: 'JetBrains Mono', monospace;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-align: center;
    box-sizing: border-box;
}

.recovery-input:focus {
    outline: none;
    border-color: #4834d4;
    box-shadow: 0 0 0 3px rgba(72, 52, 212, 0.2);
}

.recovery-input::placeholder {
    color: #666;
    text-transform: uppercase;
}

.modal-buttons {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    flex-wrap: wrap;
}

.modal-btn {
    background: linear-gradient(135deg, #4834d4, #6c5ce7);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    flex: 1;
    min-width: 120px;
}

.modal-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(72, 52, 212, 0.3);
}

.modal-btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #ccc;
}

.modal-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.1);
}

.error-text {
    color: #ff6b6b;
    font-size: 0.9rem;
    margin-top: 10px;
    padding: 10px;
    background: rgba(255, 107, 107, 0.1);
    border-radius: 6px;
    border: 1px solid rgba(255, 107, 107, 0.2);
}

/* Loading Modal */
.loading-content {
    text-align: center;
    padding: 40px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top: 4px solid #4834d4;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Hide ads when user has paid */
.ads-hidden #ad-container,
.ads-hidden #top-ad-container {
    display: none !important;
}

/* Banner ad specific styling */
.banner-ad {
    min-height: 90px;
    background: linear-gradient(135deg, #2d5016 0%, #4a7c59 100%);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 15px;
}

.banner-ad h4 {
    flex: 1;
    min-width: 200px;
}

.banner-ad p {
    flex: 2;
    min-width: 250px;
    text-align: left;
}

.banner-ad .ad-cta {
    flex-shrink: 0;
}

/* Responsive Modal Styles */
@media (max-width: 768px) {
    .modal-content {
        margin: 20px;
        width: calc(100% - 40px);
    }
    
    .modal-header {
        padding: 20px 20px 0;
    }
    
    .modal-body {
        padding: 20px;
    }
    
    .ad-removal-section {
        flex-direction: column;
        align-items: center;
    }
    
    .remove-ads-btn,
    .restore-ads-btn {
        width: 100%;
        max-width: 280px;
    }
    
    .modal-buttons {
        flex-direction: column;
    }
    
    .modal-btn {
        flex: none;
        width: 100%;
    }
}

@media (max-width: 320px) {
    .title {
        font-size: 1.5rem;
    }
    
    .debt-amount {
        /* Font size will be handled dynamically by JavaScript */
    }
}

/* Footer Links */
.footer-links {
    text-align: center;
    padding: 20px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
}

.footer-separator {
    color: rgba(255, 255, 255, 0.3);
    margin: 0 0.5rem;
}

.footer-link, .privacy-link {
    color: #888;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.footer-link:hover, .privacy-link:hover {
    color: #ccc;
    text-decoration: underline;
}

/* Capacitor Mobile App Styles */
.capacitor-app {
    /* Prevent iOS bounce scrolling */
    -webkit-overflow-scrolling: touch;
}

/* Safe area insets for notched devices */
.capacitor-app .container {
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
}

/* iOS status bar padding */
@supports (padding-top: constant(safe-area-inset-top)) {
    .capacitor-app .container {
        padding-top: constant(safe-area-inset-top);
        padding-bottom: constant(safe-area-inset-bottom);
    }
}

/* Native app specific adjustments */
.capacitor-app .modal {
    /* Account for status bar on mobile */
    top: env(safe-area-inset-top);
}

/* Disable text selection in native app for better UX */
.capacitor-app {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Allow text selection in input fields */
.capacitor-app input,
.capacitor-app textarea {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

/* Stripe Checkout Compatibility Fixes */
body:has(iframe[src*="checkout.stripe.com"]) {
    overflow: auto !important;
    position: static !important;
}

/* Ensure Stripe iframes work properly on desktop */
iframe[src*="stripe.com"],
iframe[src*="checkout.stripe.com"] {
    border: none !important;
    background: transparent !important;
    width: 100% !important;
    height: 100% !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    z-index: 999999 !important;
    display: block !important;
}

/* Disable backdrop filters and transforms during Stripe checkout */
body.stripe-checkout-active,
body.stripe-checkout-active * {
    backdrop-filter: none !important;
    filter: none !important;
    transform: none !important;
    animation: none !important;
    transition: none !important;
}

/* Ensure no CSS interferes with Stripe elements */
body.stripe-checkout-active .container,
body.stripe-checkout-active .modal,
body.stripe-checkout-active .cookie-consent-banner {
    display: none !important;
}

/* Fix for desktop viewport issues with Stripe */
@media (min-width: 1024px) {
    body:has(iframe[src*="checkout.stripe.com"]) {
        overflow: visible !important;
        height: 100vh !important;
        width: 100vw !important;
    }
    
    iframe[src*="checkout.stripe.com"] {
        min-width: 100vw !important;
        min-height: 100vh !important;
    }
}

/* Version Footer */
.version-footer {
    text-align: center;
    padding: 10px 0;
    margin-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.version-text {
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.75rem;
    font-weight: 400;
    letter-spacing: 0.5px;
}
