/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #4f46e5;
    --primary-dark: #4338ca;
    --primary-light: #6366f1;
    --secondary-color: #06b6d4;
    --accent-color: #f59e0b;
    --background: #fefefe;
    --surface: #ffffff;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --border-color: #e5e7eb;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 10px 25px rgba(79, 70, 229, 0.15);
    --gradient: linear-gradient(135deg, #4f46e5 0%, #06b6d4 50%, #3b82f6 100%);
    --gradient-soft: linear-gradient(135deg, #6366f1 0%, #06b6d4 100%);
    --success: #10b981;
    --success-light: #34d399;
    --hover-bg: #f3f4f6;
    --card-hover: #fafafa;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100vw;
}

/* Header Styles */
.header {
    background: var(--gradient);
    color: white;
    padding: 1rem 1.5rem;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.15);
    z-index: 1000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.logo h1 {
    font-size: 2.1875rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin: 0;
    line-height: 1;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.arrow-triangle {
    display: inline-block;
    vertical-align: middle;
    margin-left: -5px;
}

.swoosh {
    margin-top: -2px;
    opacity: 0.9;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}

.logo-go {
    color: #10b981;
    font-weight: 700;
}

.tagline {
    font-size: 0.95rem;
    opacity: 0.95;
    font-weight: 400;
}

/* Main Content Layout */
.main-content {
    flex: 1;
    display: flex;
    position: relative;
    overflow: hidden;
}

/* Sidebar Styles */
.sidebar {
    width: 350px;
    background: var(--surface);
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
    z-index: 900;
    transition: transform 0.3s ease;
    border-right: 1px solid var(--border-color);
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--gradient);
    color: white;
    box-shadow: 0 2px 4px rgba(79, 70, 229, 0.1);
}

.sidebar-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
}

.close-btn {
    background: rgba(255, 255, 255, 0.25);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    line-height: 1;
    backdrop-filter: blur(10px);
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.35);
    transform: scale(1.1);
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

/* Country List Styles */
.country-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.country-item {
    padding: 1rem;
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.country-item:hover {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-color: var(--primary-light);
    transform: translateX(4px);
    box-shadow: var(--shadow-sm);
}

.country-item.active {
    background: var(--gradient-soft);
    color: white;
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
}

.country-name {
    font-weight: 500;
    font-size: 0.95rem;
}

.country-count {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary-color);
}

.country-item.active .country-count {
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(10px);
    color: white;
}

/* ATM List Styles */
.atm-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.atm-item {
    padding: 1rem;
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.atm-item:hover {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-color: var(--accent-color);
    box-shadow: var(--shadow-sm);
    transform: translateY(-2px);
}

.atm-name {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.atm-address {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.atm-type {
    display: inline-block;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    margin-top: 0.5rem;
    box-shadow: 0 2px 4px rgba(79, 70, 229, 0.2);
}

/* ATM Details Styles */
.atm-details {
    padding: 1rem;
}

.back-button {
    background: var(--gradient-soft);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
    box-shadow: var(--shadow-sm);
}

.back-button:hover {
    background: var(--gradient);
    transform: translateX(-2px);
    box-shadow: var(--shadow-md);
}

.detail-item {
    margin-bottom: 1rem;
    padding: 1rem;
    background: linear-gradient(135deg, #ffffff 0%, #f9fafb 100%);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    border-left: 3px solid var(--primary-color);
    transition: all 0.2s;
}

.detail-item:hover {
    box-shadow: var(--shadow-sm);
    transform: translateX(2px);
}

.detail-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
    font-weight: 600;
}

.detail-value {
    font-size: 1rem;
    color: var(--text-primary);
    font-weight: 500;
}

/* Map Container */
.map-container {
    flex: 1;
    position: relative;
    background: var(--border-color);
}

#map {
    width: 100%;
    height: 100%;
}

.map-controls {
    position: absolute;
    top: 1rem;
    left: 1rem;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.control-btn {
    background: white;
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    box-shadow: var(--shadow-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    color: var(--primary-color);
    backdrop-filter: blur(10px);
}

.control-btn:hover {
    background: var(--gradient-soft);
    color: white;
    transform: scale(1.05);
    box-shadow: var(--shadow-lg);
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    transition: opacity 0.3s;
}

.loading-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #e0e7ff;
    border-top-color: var(--primary-color);
    border-right-color: var(--secondary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-overlay p {
    margin-top: 1rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Custom Leaflet Styles */
.leaflet-popup-content-wrapper {
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
}

.leaflet-popup-content {
    margin: 1rem;
    font-family: 'Inter', sans-serif;
}

.leaflet-popup-content h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
    font-weight: 600;
}

.leaflet-popup-content p {
    margin: 0.25rem 0;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        align-items: flex-start;
    }

    .logo h1 {
        font-size: 1.875rem;
    }
    
    .arrow-triangle {
        width: 26px;
        height: 26px;
    }
    
    .swoosh {
        width: 100px;
        height: 16px;
    }

    .tagline {
        font-size: 0.875rem;
    }

    .sidebar {
        position: absolute;
        top: 0;
        left: 0;
        height: 100%;
        width: 85%;
        max-width: 350px;
        transform: translateX(-100%);
        z-index: 1000;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .map-controls {
        top: 0.5rem;
        left: 0.5rem;
    }

    .control-btn {
        width: 40px;
        height: 40px;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 0.75rem 1rem;
    }

    .logo h1 {
        font-size: 1.5625rem;
    }
    
    .arrow-triangle {
        width: 23px;
        height: 23px;
    }
    
    .swoosh {
        width: 80px;
        height: 14px;
    }

    .sidebar {
        width: 90%;
    }

    .sidebar-header {
        padding: 1rem;
    }

    .sidebar-content {
        padding: 0.75rem;
    }

    .country-item {
        padding: 0.75rem;
    }
}

/* Scrollbar Styling */
.sidebar-content::-webkit-scrollbar {
    width: 6px;
}

.sidebar-content::-webkit-scrollbar-track {
    background: var(--background);
}

.sidebar-content::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.sidebar-content::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* Animation for list items */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.country-item,
.atm-item {
    animation: fadeIn 0.3s ease;
}

