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

body {
    font-family: 'JetBrains Mono', monospace;
    background: #f5f5f5;
    color: #333;
    min-height: 100vh;
    padding: 0;
}

/* Dark mode */
body.dark-mode {
    background: #1a1a1a;
    color: #e0e0e0;
}

/* Top Header */
.top-header {
    background: white;
    border-bottom: 1px solid #e2e8f0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
}

body.dark-mode .top-header {
    background: #2d3748;
    border-bottom-color: #4a5568;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.language-selector {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.language-icon {
    color: #4a5568;
}

body.dark-mode .language-icon {
    color: #cbd5e0;
}

.language-dropdown {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f7fafc;
    color: #2d3748;
    cursor: pointer;
    transition: all 0.2s ease;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

body.dark-mode .language-dropdown {
    background: #1a202c;
    border-color: #4a5568;
    color: #e2e8f0;
}

.language-dropdown:hover {
    border-color: #cbd5e0;
}

body.dark-mode .language-dropdown:hover {
    border-color: #718096;
}

.language-dropdown:focus {
    outline: none;
    border-color: #3182ce;
}

/* Map Section */
.map-section {
    max-width: 1200px;
    margin: 3rem auto;
    padding: 0 2rem;
}

.map-section h2 {
    font-size: 1.75rem;
    margin-bottom: 1.5rem;
    color: #2d3748;
    text-align: center;
}

body.dark-mode .map-section h2 {
    color: #e2e8f0;
}

.map-legend {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: #4a5568;
}

body.dark-mode .legend-item {
    color: #cbd5e0;
}

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    border: 1px solid #cbd5e0;
}

body.dark-mode .legend-color {
    border-color: #4a5568;
}

.vignette-color {
    background-color: #fbbf24;
}

.toll-color {
    background-color: #ef4444;
}

.toll-free-color {
    background-color: #10b981;
}

.world-map-container {
    background: white;
    border-radius: 12px;
    padding: 0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    height: 500px;
    position: relative;
    z-index: 1;
}

body.dark-mode .world-map-container {
    background: #2d3748;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

#world-map {
    width: 100%;
    height: 500px;
    min-height: 500px;
    border-radius: 12px;
    z-index: 1;
}

/* Improve SVG rendering quality */
#world-map svg {
    shape-rendering: geometricPrecision;
}

#world-map path {
    stroke-linejoin: round;
    stroke-linecap: round;
}

/* Leaflet customization */
.leaflet-container {
    cursor: crosshair;
}

.leaflet-interactive {
    cursor: pointer !important;
}

.leaflet-interactive:hover {
    cursor: pointer !important;
}

/* Leaflet popup customization */
.leaflet-popup-content-wrapper {
    font-family: 'JetBrains Mono', monospace;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.leaflet-popup-content {
    margin: 10px 12px;
    font-size: 0.875rem;
}

body.dark-mode .leaflet-popup-content-wrapper {
    background: #1a202c;
    color: #e2e8f0;
}

body.dark-mode .leaflet-popup-tip {
    background: #1a202c;
}

/* Leaflet controls styling */
.leaflet-control-zoom a {
    font-family: 'JetBrains Mono', monospace;
}

body.dark-mode .leaflet-control-zoom a {
    background: #2d3748;
    color: #e2e8f0;
}

body.dark-mode .leaflet-control-zoom a:hover {
    background: #4a5568;
}

/* Map tooltip styling */
.map-country-tooltip {
    padding: 0.5rem 0.75rem;
    background: rgba(0, 0, 0, 0.95) !important;
    color: white !important;
    border-radius: 6px !important;
    font-size: 0.875rem !important;
    font-family: 'JetBrains Mono', monospace !important;
    border: 2px solid white !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4) !important;
    font-weight: 500;
}

body.dark-mode .map-country-tooltip {
    background: rgba(255, 255, 255, 0.98) !important;
    color: #1a202c !important;
    border: 2px solid #1a202c !important;
}

.leaflet-tooltip-top:before,
.leaflet-tooltip-bottom:before,
.leaflet-tooltip-left:before,
.leaflet-tooltip-right:before {
    border: none !important;
}

/* Footer */
.footer {
    background: white;
    border-top: 1px solid #e2e8f0;
    padding: 2rem;
    margin-top: 4rem;
}

body.dark-mode .footer {
    background: #2d3748;
    border-top-color: #4a5568;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
}

/* Report Issue Button */
.report-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    font-weight: 500;
    color: #718096;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    cursor: pointer;
    transition: all 0.2s ease;
}

.report-button:hover {
    background: #edf2f7;
    color: #4a5568;
    border-color: #cbd5e0;
    transform: translateY(-1px);
}

body.dark-mode .report-button {
    background: #1a202c;
    border-color: #4a5568;
    color: #a0aec0;
}

body.dark-mode .report-button:hover {
    background: #2d3748;
    color: #cbd5e0;
    border-color: #718096;
}

.report-button svg {
    flex-shrink: 0;
}

/* Report Dialog Specific Styles */
.report-dialog-content {
    max-width: 600px;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    color: #4a5568;
    margin-bottom: 0.5rem;
}

body.dark-mode .form-group label {
    color: #cbd5e0;
}

.form-input,
.form-textarea {
    font-family: 'JetBrains Mono', monospace;
    width: 100%;
    font-size: 0.9rem;
    padding: 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: white;
    color: #2d3748;
    transition: all 0.2s ease;
}

.form-input:focus,
.form-textarea:focus {
    outline: none;
    border-color: #3182ce;
    box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.1);
}

body.dark-mode .form-input,
body.dark-mode .form-textarea {
    background: #1a202c;
    border-color: #4a5568;
    color: #e2e8f0;
}

body.dark-mode .form-input:focus,
body.dark-mode .form-textarea:focus {
    border-color: #3182ce;
    box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.2);
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.page-header {
    text-align: center;
    margin-bottom: 3rem;
}

.page-header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
    color: #2d3748;
}

body.dark-mode .page-header h1 {
    color: #f7fafc;
}

.page-header p {
    font-size: 1.1rem;
    opacity: 0.7;
}

.section {
    margin-bottom: 3rem;
}

.section-title {
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #e2e8f0;
    color: #2d3748;
}

body.dark-mode .section-title {
    color: #f7fafc;
    border-bottom-color: #2d3748;
}

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

.country-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 180px;
    position: relative;
}

body.dark-mode .country-card {
    background: #2d3748;
    border-color: #4a5568;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.country-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

body.dark-mode .country-card:hover {
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
}

.country-card:active {
    transform: translateY(-2px);
}

.flag {
    font-size: 4rem;
    margin-bottom: 1rem;
    line-height: 1;
}

.country-name {
    font-size: 1.25rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 0.5rem;
}

body.dark-mode .country-name {
    color: #f7fafc;
}

.country-abv {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    font-size: 0.75rem;
    color: #718096;
    font-weight: 600;
    background: #f7fafc;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    line-height: 1;
}

body.dark-mode .country-abv {
    background: #1a202c;
    color: #a0aec0;
}

.theme-toggle {
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

body.dark-mode .theme-toggle {
    background: #1a202c;
    border-color: #4a5568;
}

.theme-toggle:hover {
    background: #e2e8f0;
}

body.dark-mode .theme-toggle:hover {
    background: #2d3748;
}

.theme-icon {
    color: #2d3748;
    transition: transform 0.3s ease;
}

body.dark-mode .theme-icon {
    color: #f7fafc;
}

.theme-toggle:hover .theme-icon {
    transform: rotate(20deg);
}

/* Show sun in light mode, moon in dark mode */
.sun-icon {
    display: block;
}

.moon-icon {
    display: none;
}

body.dark-mode .sun-icon {
    display: none;
}

body.dark-mode .moon-icon {
    display: block;
}

/* Dialog styles */
.dialog-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.dialog-overlay.active {
    display: flex;
}

.dialog-content {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    overflow: hidden;
    animation: dialogSlideIn 0.3s ease;
}

body.dark-mode .dialog-content {
    background: #2d3748;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

@keyframes dialogSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.dialog-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e2e8f0;
}

body.dark-mode .dialog-header {
    border-bottom-color: #4a5568;
}

.dialog-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #2d3748;
}

body.dark-mode .dialog-header h3 {
    color: #f7fafc;
}

.dialog-body {
    padding: 1.5rem;
}

.dialog-body p {
    margin: 0 0 1rem 0;
    color: #4a5568;
    font-size: 0.95rem;
}

body.dark-mode .dialog-body p {
    color: #cbd5e0;
}

.dialog-url {
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1rem;
    word-break: break-all;
    font-size: 0.9rem;
    color: #2d3748;
    font-family: 'JetBrains Mono', monospace;
}

body.dark-mode .dialog-url {
    background: #1a202c;
    border-color: #4a5568;
    color: #e2e8f0;
}

.dialog-actions {
    padding: 1.5rem;
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    border-top: 1px solid #e2e8f0;
}

body.dark-mode .dialog-actions {
    border-top-color: #4a5568;
}

.dialog-button {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.dialog-button-cancel {
    background: #e2e8f0;
    color: #2d3748;
}

body.dark-mode .dialog-button-cancel {
    background: #4a5568;
    color: #e2e8f0;
}

.dialog-button-cancel:hover {
    background: #cbd5e0;
}

body.dark-mode .dialog-button-cancel:hover {
    background: #718096;
}

.dialog-button-confirm {
    background: #3182ce;
    color: white;
}

.dialog-button-confirm:hover {
    background: #2c5282;
}

.dialog-button:active {
    transform: scale(0.98);
}

@media (max-width: 768px) {
    .header-content {
        padding: 1rem;
    }

    .map-section {
        padding: 0 1rem;
    }

    .map-legend {
        gap: 1rem;
        justify-content: flex-start;
        margin-top: 1rem;
    }
    
    .legend-item {
        font-size: 1rem;
    }
    
    .legend-color {
        width: 24px;
        height: 24px;
    }

    .world-map-container {
        padding: 1rem;
    }

    .footer {
        padding: 1.5rem 1rem;
        margin-top: 3rem;
    }

    .container {
        padding: 1rem;
    }
    
    .page-header h1 {
        font-size: 2rem;
    }
    
    /* Always show minimum 2 columns on mobile */
    .cards-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .country-card {
        padding: 1.5rem;
        min-height: 150px;
    }
    
    .flag {
        font-size: 3rem;
    }

    .dialog-content {
        max-width: 95%;
    }

    .dialog-actions {
        flex-direction: column;
    }

    .dialog-button {
        width: 100%;
    }

    .language-dropdown {
        font-size: 0.85rem;
        padding: 0.4rem 0.6rem;
    }
}

/* Small mobile devices */
@media (max-width: 400px) {
    .header-content {
        padding: 0.75rem;
    }

    .container {
        padding: 0.75rem;
    }

    .page-header h1 {
        font-size: 1.5rem;
    }

    .page-header p {
        font-size: 0.9rem;
    }

    .section-title {
        font-size: 1.25rem;
    }

    /* Two columns layout */
    .cards-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .country-card {
        padding: 1rem;
        min-height: 120px;
    }

    .flag {
        font-size: 2.5rem;
        margin-bottom: 0.5rem;
    }

    .country-name {
        font-size: 0.9rem;
        margin-bottom: 0.4rem;
    }

    .country-abv {
        font-size: 0.8rem;
        padding: 0.2rem 0.5rem;
    }

    .language-dropdown {
        font-size: 0.75rem;
        padding: 0.35rem 0.5rem;
    }

    .language-icon {
        width: 16px;
        height: 16px;
    }

    .theme-toggle {
        width: 36px;
        height: 36px;
    }

    .theme-icon {
        width: 16px;
        height: 16px;
    }

    .dialog-content {
        max-width: 98%;
    }

    .dialog-header h3 {
        font-size: 1rem;
    }

    .dialog-body p {
        font-size: 0.85rem;
    }

    .dialog-url {
        font-size: 0.75rem;
        padding: 0.75rem;
    }

    .dialog-button {
        font-size: 0.85rem;
        padding: 0.6rem 1.2rem;
    }
}

