/* ===== GLOBAL STYLES ===== */

* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    margin: 0;
    padding: 0;
    background-color: #f0f0f0;
    /* Mobile optimizations */
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

/* Default layout for non-landing pages */
body.centered-layout {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

/* ===== NAVIGATION ===== */

.main-nav {
    background: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
}

.nav-brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: #667eea;
    text-decoration: none;
    transition: color 0.3s ease;
}

.nav-brand:hover {
    color: #5a6fd8;
}

.nav-links {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 2rem;
}

.nav-links a {
    color: #333;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: #667eea;
}

/* ===== MAIN APP CONTAINER ===== */

#app {
    min-height: calc(100vh - 80px); /* Account for navigation */
}

/* ===== RESULT DISPLAY (Legacy) ===== */

#result {
    font-size: 5vw;
    color: #333;
    text-align: center;
    padding: 20px;
    border: 2px solid #333;
    border-radius: 10px;
    background-color: #fff;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    max-width: 800px;
    margin: 2rem auto;
}

/* ===== ENHANCED LOADING STATES ===== */

.loading-indicator {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 2rem;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.loading-indicator.loading-fade-in {
    opacity: 1;
}

.loading-indicator.loading-fade-out {
    opacity: 0;
}

.loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    min-width: 200px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-text {
    color: #333;
    font-size: 1rem;
    font-weight: 500;
    text-align: center;
}

.loading-progress {
    width: 100%;
    height: 4px;
    background: #f3f3f3;
    border-radius: 2px;
    overflow: hidden;
}

.loading-bar {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 2px;
    width: 0%;
    transition: width 0.3s ease;
}

.loading-bar.loading-progress-active {
    animation: loadingProgress 2s ease-in-out infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes loadingProgress {
    0% { width: 0%; }
    50% { width: 70%; }
    100% { width: 100%; }
}

.initial-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 50vh;
    gap: 1rem;
}

/* ===== SMOOTH PAGE TRANSITIONS ===== */

#app {
    transition: opacity 0.15s ease-out;
}

#app.content-fade-out {
    opacity: 0;
}

#app.content-fade-in {
    opacity: 0;
    animation: fadeIn 0.3s ease-in forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Enhanced transitions for page elements */
.country-page,
.simple-home-page,
.simple-error-page,
.about-page {
    animation: slideInUp 0.4s ease-out;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Button hover transitions */
.btn,
.action-btn,
.country-btn {
    transition: all 0.2s ease;
}

.btn:hover,
.action-btn:hover,
.country-btn:hover {
    transform: translateY(-2px);
}

/* Form transitions */
.search-input,
.search-btn {
    transition: all 0.2s ease;
}

.search-input:focus {
    transform: scale(1.02);
}

/* Form focus effects */
.search-form input:focus,
.search-form select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
    transform: translateY(-1px);
}

/* Loading overlay for better UX */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.1);
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.loading-overlay.active {
    opacity: 1;
    pointer-events: all;
}

/* ===== ERROR STATES ===== */

.error-message {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #dc3545;
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
    z-index: 1000;
    animation: slideIn 0.3s ease;
}

.global-error {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #dc3545;
    color: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
    z-index: 1000;
    animation: slideIn 0.3s ease;
}

.error-content {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
}

.error-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.error-page {
    text-align: center;
    padding: 4rem 2rem;
    max-width: 600px;
    margin: 0 auto;
}

.error-page h1 {
    font-size: 2.5rem;
    color: #dc3545;
    margin-bottom: 1rem;
}

.error-page p {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 2rem;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== BUTTONS ===== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.btn-primary {
    background: #667eea;
    color: white;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    background: #5a6fd8;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #6c757d;
    color: white;
    box-shadow: 0 2px 4px rgba(108, 117, 125, 0.3);
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(108, 117, 125, 0.4);
}

.btn-outline {
    background: transparent;
    color: #667eea;
    border: 2px solid #667eea;
}

.btn-outline:hover {
    background: #667eea;
    color: white;
    transform: translateY(-1px);
}

/* ===== PAGE LAYOUTS ===== */

.home-page,
.country-page,
.suggestions-page,
.about-page,
.not-found-page {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
}

.country-header,
.suggestions-page header,
.about-page header,
.not-found-page header {
    text-align: center;
    margin-bottom: 2rem;
}

.country-header h1,
.suggestions-page h1,
.about-page h1,
.not-found-page h1 {
    font-size: 2.5rem;
    color: #333;
    margin-bottom: 0.5rem;
}

.country-header p {
    font-size: 1.1rem;
    color: #666;
}

/* ===== HOLIDAY RESULTS ===== */

.holiday-results {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.holidays-found h2 {
    color: #28a745;
    font-size: 2rem;
    margin-bottom: 1.5rem;
}

.no-holidays h2 {
    color: #6c757d;
    font-size: 2rem;
    margin-bottom: 1rem;
}

.holiday-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.holiday-item {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    border-left: 4px solid #28a745;
}

.holiday-item h3 {
    color: #333;
    margin-bottom: 0.5rem;
    font-size: 1.3rem;
}

.holiday-item p {
    color: #666;
    margin-bottom: 0.5rem;
}

.holiday-type {
    background: #667eea;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

/* ===== SUGGESTIONS ===== */

.suggestions-list {
    list-style: none;
    padding: 0;
    margin: 2rem 0;
}

.suggestion-item {
    margin-bottom: 1rem;
}

.suggestion-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    background: white;
    border-radius: 8px;
    text-decoration: none;
    color: #333;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.suggestion-link:hover {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.confidence {
    font-size: 0.9rem;
    color: #28a745;
    font-weight: 600;
}

.suggestion-link:hover .confidence {
    color: rgba(255, 255, 255, 0.9);
}

/* ===== ACTIONS ===== */

.actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 2rem;
}

/* ===== RESPONSIVE DESIGN ===== */

/* Enhanced Mobile Responsiveness for New Components */
@media (max-width: 768px) {
    .nav-container {
        padding: 1rem;
    }
    
    .nav-links {
        gap: 1rem;
    }
    
    #result {
        font-size: 8vw;
        padding: 1rem;
        margin: 1rem;
    }
    
    .home-page,
    .country-page,
    .suggestions-page,
    .about-page,
    .not-found-page {
        padding: 1rem;
    }
    
    .country-header h1,
    .suggestions-page h1,
    .about-page h1,
    .not-found-page h1 {
        font-size: 2rem;
    }
    
    .holiday-results {
        padding: 1.5rem;
    }
    
    .actions {
        flex-direction: column;
        align-items: center;
    }
    
    .btn {
        width: 100%;
        max-width: 300px;
    }
    
    /* Enhanced Loading States for Mobile */
    .loading-indicator {
        padding: 1.5rem;
        margin: 1rem;
        max-width: calc(100vw - 2rem);
        min-width: auto;
    }
    
    .loading-content {
        min-width: auto;
        width: 100%;
    }
    
    .loading-text {
        font-size: 0.9rem;
    }
    
    .spinner {
        width: 32px;
        height: 32px;
        border-width: 3px;
    }
    
    /* Mobile-Optimized Form Focus Effects */
    .search-form input:focus,
    .search-form select:focus {
        transform: none; /* Disable transform on mobile to prevent layout issues */
        box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
    }
    
    .search-input:focus {
        transform: none; /* Disable scale transform on mobile */
    }
    
    /* Touch-Friendly Button Interactions */
    .btn:hover,
    .action-btn:hover,
    .country-btn:hover {
        transform: none; /* Disable hover transforms on mobile */
    }
    
    .btn:active,
    .action-btn:active,
    .country-btn:active {
        transform: scale(0.98);
        transition: transform 0.1s ease;
    }
    
    /* Mobile Error Notifications */
    .error-message,
    .global-error {
        left: 1rem;
        right: 1rem;
        top: 1rem;
        max-width: none;
        font-size: 0.9rem;
        padding: 0.75rem 1rem;
    }
    
    /* Mobile Holiday Results */
    .holiday-item h3 {
        font-size: 1.1rem;
    }
    
    .holiday-item p {
        font-size: 0.9rem;
    }
    
    .holiday-type {
        font-size: 0.75rem;
        padding: 0.2rem 0.6rem;
    }
}

@media (max-width: 480px) {
    .nav-container {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .nav-links {
        justify-content: center;
    }
    
    #result {
        font-size: 10vw;
    }
    
    .country-header h1,
    .suggestions-page h1,
    .about-page h1,
    .not-found-page h1 {
        font-size: 1.5rem;
    }
    
    .holiday-item {
        padding: 1rem;
    }
    
    /* Extra Small Mobile Optimizations */
    .loading-indicator {
        padding: 1rem;
        border-radius: 12px;
    }
    
    .loading-text {
        font-size: 0.85rem;
    }
    
    .spinner {
        width: 28px;
        height: 28px;
        border-width: 2px;
    }
    
    /* Compact Button Styling */
    .btn {
        padding: 0.6rem 1.2rem;
        font-size: 0.9rem;
    }
    
    .action-btn {
        padding: 0.6rem 1.2rem;
        font-size: 0.85rem;
    }
    
    /* Smaller Error Messages */
    .error-message,
    .global-error {
        font-size: 0.85rem;
        padding: 0.6rem 0.8rem;
    }
    
    /* Compact Holiday Results */
    .holiday-results {
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    .holidays-found h2,
    .no-holidays h2 {
        font-size: 1.5rem;
        margin-bottom: 1rem;
    }
    
    .holiday-item {
        padding: 0.8rem;
        margin-bottom: 0.8rem;
    }
    
    .holiday-item h3 {
        font-size: 1rem;
        margin-bottom: 0.3rem;
    }
    
    .holiday-item p {
        font-size: 0.85rem;
        margin-bottom: 0.3rem;
    }
}

/* ===== MOBILE-SPECIFIC ENHANCEMENTS ===== */

/* Touch-friendly interactions for all interactive elements */
@media (hover: none) and (pointer: coarse) {
    /* This targets touch devices specifically */
    .btn,
    .action-btn,
    .country-btn,
    .suggestion-link,
    .country-link,
    .example-link {
        min-height: 44px; /* Apple's recommended minimum touch target */
        min-width: 44px;
    }
    
    /* Remove hover effects on touch devices */
    .btn:hover,
    .action-btn:hover,
    .country-btn:hover,
    .suggestion-link:hover,
    .country-link:hover,
    .example-link:hover {
        transform: none;
        background: inherit;
        color: inherit;
        box-shadow: inherit;
    }
    
    /* Enhanced active states for touch feedback */
    .btn:active,
    .action-btn:active,
    .country-btn:active {
        transform: scale(0.95);
        opacity: 0.8;
    }
    
    .suggestion-link:active,
    .country-link:active,
    .example-link:active {
        transform: scale(0.98);
        opacity: 0.9;
    }
}

/* Extra small screens (320px and below) */
@media (max-width: 320px) {
    .simple-home-page {
        padding: 0.5rem;
    }
    
    .simple-home-page .hero h1 {
        font-size: 1.5rem;
        margin-bottom: 0.5rem;
    }
    
    .simple-home-page .hero p {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .simple-home-page .search-box {
        padding: 1.5rem;
        margin-bottom: 2rem;
    }
    
    .simple-home-page .search-input,
    .simple-home-page .search-btn {
        padding: 0.8rem 1rem;
        font-size: 1rem;
    }
    
    .simple-home-page .country-btn {
        min-width: 120px;
        padding: 10px 12px;
        font-size: 13px;
    }
    
    .loading-indicator {
        padding: 0.8rem;
        margin: 0.5rem;
    }
    
    .loading-text {
        font-size: 0.8rem;
    }
    
    .spinner {
        width: 24px;
        height: 24px;
        border-width: 2px;
    }
    
    .simple-error-page {
        padding: 1.5rem 1rem;
        margin: 0.5rem;
    }
    
    .error-hero h1 {
        font-size: 1.3rem;
    }
    
    .error-hero p {
        font-size: 0.9rem;
    }
    
    .action-btn {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
        min-width: 100px;
    }
    
    .country-link {
        padding: 0.3rem 0.5rem;
        font-size: 0.75rem;
    }
}

/* Landscape orientation optimizations for mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .simple-home-page {
        min-height: auto;
        padding: 1rem;
    }
    
    .simple-home-page .hero {
        margin-bottom: 2rem;
    }
    
    .simple-home-page .hero h1 {
        font-size: 2.5rem;
    }
    
    .loading-indicator {
        padding: 1rem;
    }
    
    .simple-error-page {
        padding: 2rem 1.5rem;
    }
}

/* High DPI displays optimization */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .loading-indicator {
        backdrop-filter: blur(8px);
    }
    
    .error-page {
        backdrop-filter: blur(8px);
    }
    
    .simple-error-page {
        box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    }
}

/* ===== ACCESSIBILITY ===== */

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus styles for keyboard navigation */
.btn:focus,
.nav-links a:focus,
.suggestion-link:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .btn-primary {
        background: #000;
        border: 2px solid #fff;
    }
    
    .suggestion-link {
        border: 2px solid #333;
    }
}

/* ===== SIMPLE HOME PAGE ===== */

.simple-home-page {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.simple-home-page .hero {
    text-align: center;
    margin-bottom: 3rem;
}

.simple-home-page .hero h1 {
    font-size: 3rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 1rem;
}

.simple-home-page .hero p {
    font-size: 1.25rem;
    color: #64748b;
    margin-bottom: 2rem;
}

.simple-home-page .search-box {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    margin-bottom: 3rem;
    transition: all 0.3s ease;
}

.simple-home-page .search-form {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.simple-home-page .search-input {
    flex: 1;
    padding: 1rem 1.5rem;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 1.1rem;
    transition: border-color 0.2s;
}

.simple-home-page .search-input:focus {
    outline: none;
    border-color: #3b82f6;
}

.simple-home-page .search-btn {
    padding: 1rem 2rem;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

.simple-home-page .search-btn:hover {
    background: #2563eb;
}

.simple-home-page .help-text {
    text-align: center;
    color: #64748b;
    font-size: 0.9rem;
}

.simple-home-page .url-tip {
    text-align: center;
    color: #64748b;
    font-size: 0.8rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #f1f5f9;
}

.simple-home-page .url-tip code {
    background: #f1f5f9;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.75rem;
    color: #475569;
}

.simple-home-page .examples {
    text-align: center;
}

.simple-home-page .examples h3 {
    font-size: 1.1rem;
    color: #475569;
    margin-bottom: 1rem;
}

.simple-home-page .example-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
}

.simple-home-page .example-links a {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: #f1f5f9;
    color: #475569;
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.simple-home-page .example-links a:hover {
    background: #e2e8f0;
    transform: translateY(-1px);
}

.simple-home-page .footer {
    text-align: center;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid #e2e8f0;
    color: #64748b;
    font-size: 0.9rem;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.footer-links a {
    color: #64748b;
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.2s ease;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.footer-links a:hover {
    color: #3b82f6;
    text-decoration: underline;
}

.footer-links a:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

@media (max-width: 640px) {
    .simple-home-page {
        padding: 1rem;
    }

    .simple-home-page .hero h1 {
        font-size: 2rem;
    }

    .simple-home-page .search-form {
        flex-direction: column;
    }

    .simple-home-page .example-links {
        flex-direction: column;
        align-items: center;
    }
}

/* Country buttons styling to match standalone version */
.simple-home-page .country-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    max-width: 600px;
    margin: 0 auto;
}

.simple-home-page .country-btn {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 140px;
    justify-content: flex-start;
    font-family: inherit;
}

.simple-home-page .country-btn:hover {
    border-color: #4285f4;
    box-shadow: 0 2px 8px rgba(66, 133, 244, 0.15);
    transform: translateY(-1px);
}

.simple-home-page .country-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(66, 133, 244, 0.2);
}

@media (max-width: 640px) {
    .simple-home-page .country-buttons {
        flex-direction: column;
        align-items: center;
        max-width: 300px;
    }
    
    .simple-home-page .country-btn {
        width: 100%;
        justify-content: center;
    }
}

/* ===== INTERACTIVE EXAMPLES ===== */

/* Interactive Examples Section */
.interactive-examples {
    margin: 2rem 0;
    text-align: center;
}

.interactive-examples h3 {
    color: #333;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.example-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
    margin-bottom: 1rem;
}

.example-link {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    text-decoration: none;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(240, 147, 251, 0.3);
}

.example-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(240, 147, 251, 0.4);
    background: linear-gradient(135deg, #f5576c 0%, #f093fb 100%);
}

.example-link:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(240, 147, 251, 0.3);
}

/* Usage Examples Section */
.usage-examples {
    margin: 2rem 0;
    text-align: center;
}

.usage-examples h3 {
    color: #333;
    margin-bottom: 1.5rem;
    font-size: 1.2rem;
}

.usage-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    max-width: 800px;
    margin: 0 auto;
}

.usage-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.usage-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.usage-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.usage-text {
    text-align: left;
    font-size: 0.9rem;
    line-height: 1.4;
}

.usage-text strong {
    color: #333;
    display: block;
    margin-bottom: 0.25rem;
}

/* Responsive adjustments for interactive elements */
@media (max-width: 768px) {
    .example-links {
        flex-direction: column;
        align-items: center;
    }
    
    .example-link {
        width: 100%;
        max-width: 280px;
    }
    
    .usage-grid {
        grid-template-columns: 1fr;
    }
    
    .usage-item {
        flex-direction: column;
        text-align: center;
    }
    
    .usage-text {
        text-align: center;
    }
}

/* ===== ERROR PAGES ===== */

/* Error Page Layout */
.error-page {
    max-width: 800px;
    margin: 2rem auto;
    padding: 2rem;
    text-align: center;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.error-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    display: block;
}

.error-header {
    margin-bottom: 2rem;
}

.error-header h1 {
    color: #333;
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.error-message {
    font-size: 1.2rem;
    color: #666;
    margin-bottom: 0.5rem;
}

.error-description {
    font-size: 1rem;
    color: #888;
    margin-bottom: 0;
}

/* Error Suggestions */
.error-suggestions {
    margin: 2rem 0;
}

.error-suggestions h3 {
    color: #333;
    font-size: 1.4rem;
    margin-bottom: 1.5rem;
}

.suggestion-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.suggestion-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.suggestion-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-color: #667eea;
}

.suggestion-icon {
    font-size: 2rem;
    margin-bottom: 1rem;
    display: block;
}

.suggestion-card h4 {
    color: #333;
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.suggestion-card p {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    line-height: 1.4;
}

/* Suggestions Grid for Country Suggestions */
.suggestions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.suggestions-grid .suggestion-card {
    padding: 1rem;
}

.suggestion-link {
    text-decoration: none;
    color: inherit;
    display: block;
    width: 100%;
    height: 100%;
}

.suggestion-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.country-flag {
    font-size: 1.5rem;
}

.country-name {
    color: #333;
    font-size: 1rem;
    font-weight: 600;
}

.suggestion-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: #888;
}

.confidence {
    background: #e8f5e8;
    color: #2d5a2d;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-weight: 500;
}

.country-code {
    background: #f0f0f0;
    color: #666;
    padding: 0.2rem 0.5rem;
    border-radius: 8px;
    font-family: monospace;
}

/* Popular Countries Mini */
.popular-countries-mini {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.country-link {
    display: inline-block;
    padding: 0.5rem 0.75rem;
    background: #f8f9fa;
    color: #333;
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.country-link:hover {
    background: #667eea;
    color: white;
    transform: translateX(4px);
}

/* Error Help Section */
.error-help {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 1.5rem;
    margin: 2rem 0;
    text-align: left;
}

.error-help h4 {
    color: #333;
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.help-tips {
    list-style: none;
    padding: 0;
    margin: 0;
}

.help-tips li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #e9ecef;
    position: relative;
    padding-left: 1.5rem;
}

.help-tips li:last-child {
    border-bottom: none;
}

.help-tips li::before {
    content: "💡";
    position: absolute;
    left: 0;
    top: 0.5rem;
}

/* Error Actions */
.error-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 2rem;
}

/* Error Notifications */
.error-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    max-width: 400px;
    border-left: 4px solid #dc3545;
}

.error-notification--error {
    border-left-color: #dc3545;
}

.error-notification--warning {
    border-left-color: #ffc107;
}

.error-notification--info {
    border-left-color: #17a2b8;
}

.error-notification--success {
    border-left-color: #28a745;
}

.error-notification--visible {
    transform: translateX(0);
}

.error-content {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
}

.error-icon {
    flex-shrink: 0;
}

.error-text {
    flex: 1;
    color: #333;
    font-size: 0.9rem;
    line-height: 1.4;
}

.error-close {
    background: none;
    border: none;
    color: #999;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.error-close:hover {
    background: #f0f0f0;
    color: #666;
}

/* Responsive Design for Error Pages */
@media (max-width: 768px) {
    .error-page {
        margin: 1rem;
        padding: 1.5rem;
    }
    
    .error-icon {
        font-size: 3rem;
    }
    
    .error-header h1 {
        font-size: 2rem;
    }
    
    .suggestion-cards {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .suggestions-grid {
        grid-template-columns: 1fr;
    }
    
    .error-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .error-actions .btn {
        width: 100%;
        max-width: 250px;
    }
    
    .error-notification {
        left: 10px;
        right: 10px;
        max-width: none;
        transform: translateY(-100%);
    }
    
    .error-notification--visible {
        transform: translateY(0);
    }
}

@media (max-width: 480px) {
    .error-header h1 {
        font-size: 1.8rem;
    }
    
    .error-message {
        font-size: 1rem;
    }
    
    .suggestion-card {
        padding: 1rem;
    }
    
    .popular-countries-mini {
        gap: 0.25rem;
    }
    
    .country-link {
        padding: 0.4rem 0.6rem;
        font-size: 0.8rem;
    }
}

/* ===== SIMPLE ERROR PAGES - CLEAN DESIGN ===== */

.simple-error-page {
    background: white;
    padding: 3rem 2rem;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    text-align: center;
    max-width: 500px;
    margin: 2rem auto;
}

.error-hero h1 {
    font-size: 1.75rem;
    color: #1e293b;
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.error-hero p {
    color: #64748b;
    font-size: 1rem;
    margin-bottom: 2rem;
}

.error-actions {
    margin: 2rem 0;
}

.action-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.action-btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
}

.action-btn.primary {
    background: #2563eb;
    color: white;
}

.action-btn.primary:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
}

.action-btn.secondary {
    background: #f8fafc;
    color: #64748b;
    border: 1px solid #e2e8f0;
}

.action-btn.secondary:hover {
    background: #f1f5f9;
}

.error-suggestions {
    margin: 2rem 0;
}

.error-suggestions h3 {
    color: #1e293b;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    font-weight: 500;
}

.country-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 1rem;
}

.country-link {
    display: inline-block;
    padding: 0.5rem 0.75rem;
    background: #f8fafc;
    color: #475569;
    text-decoration: none;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    transition: all 0.2s;
    font-size: 0.875rem;
}

.country-link:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.search-tips {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e2e8f0;
}

.search-tips p {
    color: #64748b;
    font-size: 0.9rem;
}

/* Responsive Design for Simple Error Pages */
@media (max-width: 768px) {
    .simple-error-page {
        padding: 2rem 1.5rem;
        margin: 1rem;
    }

    .error-hero h1 {
        font-size: 1.5rem;
    }

    .action-buttons {
        flex-direction: column;
        align-items: center;
    }

    .action-btn {
        width: 100%;
        max-width: 180px;
    }

    .country-links {
        gap: 0.375rem;
    }

    .country-link {
        font-size: 0.8rem;
        padding: 0.375rem 0.625rem;
    }
}

/* ===== ENHANCED ACCESSIBILITY FEATURES ===== */

/* Screen reader only content */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Skip navigation link */
.skip-nav {
    position: absolute;
    top: -40px;
    left: 6px;
    background: #667eea;
    color: white;
    padding: 8px 16px;
    text-decoration: none;
    border-radius: 0 0 4px 4px;
    z-index: 1001;
    font-weight: 600;
    transition: top 0.3s ease;
}

.skip-nav:focus {
    top: 0;
    outline: 2px solid #fff;
    outline-offset: 2px;
}

/* Enhanced focus styles for keyboard navigation */
.btn:focus,
.nav-links a:focus,
.suggestion-link:focus,
.country-btn:focus,
.country-link:focus,
.action-btn:focus,
.search-input:focus,
.search-btn:focus {
    outline: 3px solid #667eea !important;
    outline-offset: 2px !important;
    box-shadow: 0 0 0 1px #fff, 0 0 0 4px #667eea !important;
}

/* Focus styles for interactive elements */
button:focus,
input:focus,
select:focus,
textarea:focus,
a:focus {
    outline: 3px solid #667eea !important;
    outline-offset: 2px !important;
}

/* Remove default focus outline and add custom */
*:focus {
    outline: none;
}

/* Ensure focus is visible for all interactive elements */
.country-btn:focus-visible,
.action-btn:focus-visible,
.btn:focus-visible {
    outline: 3px solid #667eea !important;
    outline-offset: 2px !important;
    box-shadow: 0 0 0 1px #fff, 0 0 0 4px #667eea !important;
}

/* Enhanced reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .loading-indicator {
        animation: none !important;
    }
    
    .spinner {
        animation: none !important;
        border-top-color: #667eea;
    }
    
    .loading-bar {
        animation: none !important;
    }
    
    .loading-progress-active {
        animation: none !important;
    }
}

/* Enhanced high contrast mode support */
@media (prefers-contrast: high) {
    .skip-nav {
        background: #000;
        border: 2px solid #fff;
    }
    
    .loading-indicator {
        border: 2px solid #000;
        background: #fff;
    }
    
    .country-btn:focus,
    .action-btn:focus,
    .btn:focus {
        outline: 3px solid #000 !important;
        background: #fff !important;
        color: #000 !important;
    }
}

/* Focus management for loading states */
.loading-indicator[aria-hidden="false"] {
    pointer-events: auto;
}

.loading-indicator[aria-hidden="true"] {
    pointer-events: none;
}

/* Improve text readability */
.usage-text,
.error-hero p,
.search-tips p {
    line-height: 1.6;
    max-width: 70ch; /* Optimal reading width */
}

/* Error message accessibility */
.error-notification {
    role: alert;
}

/* Keyboard navigation indicators */
.country-btn:focus::after,
.action-btn:focus::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border: 2px solid #667eea;
    border-radius: inherit;
    pointer-events: none;
}

/* ===== ADSENSE AD STYLING ===== */

.ad-container {
    margin: 2rem auto;
    padding: 1rem;
    max-width: 800px;
    text-align: center;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    transition: opacity 0.3s ease;
}

.ad-container.loading {
    opacity: 0.7;
}

.ad-container.error {
    display: none;
}

.ad-label {
    font-size: 0.75rem;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-family: inherit;
}

.adsbygoogle {
    display: block;
    margin: 0 auto;
    background: transparent;
}

/* Ad container variations */
.ad-container.bottom-content {
    margin-top: 3rem;
    margin-bottom: 2rem;
}

.ad-container.mobile-footer {
    margin: 1.5rem auto;
    max-width: 320px;
}

.ad-container.error-page {
    margin: 1.5rem auto;
    max-width: 600px;
    background: #fff;
    border: 1px solid #dee2e6;
}

/* Responsive ad sizing */
.ad-container ins {
    min-height: 90px;
    min-width: 320px;
    max-width: 100%;
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .ad-container {
        margin: 1.5rem auto;
        padding: 0.75rem;
        border-radius: 6px;
    }
    
    .ad-container.mobile-footer {
        max-width: 300px;
        margin: 1rem auto;
    }
    
    .ad-container ins {
        min-height: 250px;
        min-width: 300px;
    }
    
    .ad-label {
        font-size: 0.7rem;
        margin-bottom: 0.4rem;
    }
}

/* Desktop optimizations */
@media (min-width: 769px) {
    .ad-container ins {
        min-height: 250px;
        min-width: 728px;
    }
    
    .ad-container.mobile-footer {
        display: none; /* Hide mobile-specific ads on desktop */
    }
}

/* Large desktop optimizations */
@media (min-width: 1200px) {
    .ad-container {
        max-width: 970px;
    }
    
    .ad-container ins {
        min-width: 970px;
        min-height: 250px;
    }
}

/* Ad loading states */
.ad-container.loading::after {
    content: 'Loading advertisement...';
    display: block;
    color: #6c757d;
    font-size: 0.8rem;
    margin-top: 1rem;
    font-style: italic;
}

.ad-container:not(.loading)::after {
    display: none;
}

/* Ad error states */
.ad-container.ad-blocked {
    background: #fff3cd;
    border-color: #ffeaa7;
    color: #856404;
}

.ad-container.ad-blocked::after {
    content: 'Ad blocked or failed to load';
    display: block;
    font-size: 0.8rem;
    margin-top: 0.5rem;
}

/* High contrast mode support for ads */
@media (prefers-contrast: high) {
    .ad-container {
        border: 2px solid #000;
        background: #fff;
    }
    
    .ad-label {
        color: #000;
        font-weight: 600;
    }
}

/* Reduced motion support for ads */
@media (prefers-reduced-motion: reduce) {
    .ad-container {
        transition: none;
    }
}

/* Print styles - hide ads when printing */
@media print {
    .ad-container {
        display: none !important;
    }
}

/* Ad container focus styles for accessibility */
.ad-container:focus-within {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* Ensure ads don't interfere with main content */
.ad-container + .footer {
    margin-top: 2rem;
}

.ad-container + .actions {
    margin-top: 2rem;
}

/* Ad spacing in different contexts */
.simple-home-page .ad-container {
    margin-top: 3rem;
    margin-bottom: 1rem;
}

.country-page .ad-container {
    margin-top: 2rem;
    margin-bottom: 2rem;
}

.simple-error-page .ad-container {
    margin-top: 2rem;
    margin-bottom: 1rem;
    max-width: 500px;
}

/* Ensure ads are properly contained */
.ad-container * {
    max-width: 100%;
    box-sizing: border-box;
}

/* Ad container hover effects (subtle) */
.ad-container:hover {
    background: #f1f3f4;
    border-color: #dee2e6;
}

/* Ensure proper text rendering in ads */
.ad-container {
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Ensure proper button positioning for focus indicators */
.country-btn,
.action-btn {
    position: relative;
}

/* Enhanced mobile accessibility */
@media (max-width: 768px) {
    .skip-nav {
        left: 4px;
        padding: 6px 12px;
        font-size: 0.9rem;
    }
    
    /* Larger touch targets for mobile */
    .country-btn,
    .action-btn,
    .btn {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Enhanced focus visibility on mobile */
    .country-btn:focus,
    .action-btn:focus,
    .btn:focus {
        outline: 4px solid #667eea !important;
        outline-offset: 2px !important;
    }
}
