/* Global Styles */
body {
    margin: 0;
    padding: 0;
    overflow: hidden;
    height: 100vh;
    background: linear-gradient(135deg, #f0f6ff 0%, #e6f0ff 100%);
    font-family: "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
}

.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    background: rgba(255, 255, 255, 0.3);
}

/* Navigation Bar */
.navbar {
    background: rgba(255, 255, 255, 0.85) !important;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.5);
    padding: 0.7rem 1.5rem;
}

.navbar-brand {
    font-size: 2rem;
    font-weight: 300;
    color: #2196f3 !important;
    text-shadow: 0 1px 1px rgba(255, 255, 255, 0.8);
    letter-spacing: 0.5px;
}

.nav-link {
    font-size: 1.2rem;
    color: #555 !important;
    font-weight: 300;
    padding: 0.5rem 1.2rem;
    margin: 0 0.2rem;
    border-radius: 20px;
    transition: all 0.3s ease;
}

.nav-link:hover {
    background: rgba(33, 150, 243, 0.1);
}

.nav-link.disabled {
    color: #999 !important;
    cursor: not-allowed;
    opacity: 0.6;
}

/* Content Layout */
.content-container {
    flex: 1;
    display: flex;
    position: relative;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px);
}

/* View Toggle Button */
.view-toggle-btn {
    background: transparent;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    color: #2196f3;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 300;
}

.view-toggle-btn:hover {
    background: rgba(33, 150, 243, 0.1);
    transform: translateY(-1px);
}

.view-toggle-btn.active {
    background: rgba(33, 150, 243, 0.15);
    color: #1976d2;
}

.view-text {
    min-width: 40px;
    text-align: center;
}

/* Map Container */
#map-container {
    flex: 1;
    position: relative;
    overflow: hidden;
    background: rgba(240, 248, 255, 0.3);
    border-radius: 15px;
    margin: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    perspective: 1000px;
    touch-action: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    transform-style: preserve-3d;
    -webkit-transform-style: preserve-3d;
    -webkit-perspective: 1000px;
}

#map-container svg {
    width: 100%;
    height: 100%;
    transform-origin: center center;
    will-change: transform;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    transform: translate3d(0, 0, 0);
    -webkit-transform: translate3d(0, 0, 0);
    -webkit-transform-style: preserve-3d;
    transform-style: preserve-3d;
}

#map-container.view-3d svg {
    transform: rotateX(20deg) scale(1.1);
    transition: transform 0.5s ease;
}

/* Mode Indicator */
#mode-indicator {
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 16px;
    height: 16px;
    z-index: 9999;
    pointer-events: none;
    display: none;
}

#mode-indicator.active {
    display: block;
}

.mode-dot {
    width: 100%;
    height: 100%;
    background: #2196f3;
    border-radius: 50%;
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.8),
                0 0 8px rgba(33, 150, 243, 0.6);
    border: 2px solid #ffffff;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(33, 150, 243, 0.6),
                    0 0 0 4px rgba(255, 255, 255, 0.8);
    }
    70% {
        box-shadow: 0 0 0 6px rgba(33, 150, 243, 0),
                    0 0 0 8px rgba(255, 255, 255, 0.4);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(33, 150, 243, 0),
                    0 0 0 4px rgba(255, 255, 255, 0.8);
    }
}

/* Walk Mode Button */
.walk-mode-btn {
    position: absolute;
    left: 30px;
    bottom: 30px;
    width: 50px;
    height: 50px;
    border-radius: 25px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 5px;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.walk-mode-btn:hover {
    background: rgba(255, 255, 255, 1);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.walk-mode-btn.active {
    background: rgba(33, 150, 243, 0.1);
    border-color: rgba(33, 150, 243, 0.3);
}

.walk-mode-btn svg {
    width: 30px;
    height: 30px;
    transition: all 0.3s ease;
}

.walk-mode-btn:hover svg {
    fill: #2196f3;
}

/* Flag Button */
.flag-btn {
    position: absolute;
    left: 90px;
    bottom: 30px;
    width: 50px;
    height: 50px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    cursor: grab;
    transition: all 0.3s ease;
    padding: 5px;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.flag-btn:hover {
    background: rgba(255, 255, 255, 1);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.flag-btn.dragging {
    cursor: grabbing;
    opacity: 0.8;
    transform: scale(1.1);
}

/* Planted Flag */
.planted-flag {
    cursor: pointer;
    pointer-events: all;
}

.planted-flag .flag-pole {
    fill: #555;
    stroke: none;
    transition: fill 0.3s ease;
}

.planted-flag .flag-marker {
    fill: #2196f3;
    stroke: white;
    stroke-width: 2;
    cursor: pointer;
    transition: fill 0.3s ease;
}

.planted-flag:hover .flag-marker {
    fill: #1976d2;
}

.planted-flag:hover .flag-pole {
    fill: #333;
}

/* Dragged Flag */
.dragged-flag {
    position: absolute;
    pointer-events: none;
    z-index: 1001;
    cursor: grabbing;
    opacity: 0.8;
    transform: scale(1.1);
    transition: transform 0.3s ease;
}

/* Flag Info Box */
.flag-info-box {
    position: absolute;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    padding: 15px;
    min-width: 200px;
    z-index: 1002;
    display: none;
}

.flag-info-box.active {
    display: block;
}

.flag-info-box h4 {
    margin: 0 0 10px 0;
    color: #333;
}

.flag-info-box p {
    margin: 0 0 10px 0;
    color: #666;
}

.flag-info-box .travel-btn {
    background: #2196f3;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    margin-top: 10px;
}

.flag-info-box .travel-btn:hover {
    background: #1976d2;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(33, 150, 243, 0.3);
}

/* Country Styling */
.country {
    fill: rgba(224, 224, 224, 0.8);
    stroke: rgba(255, 255, 255, 0.9);
    stroke-width: 0.5;
    transition: all 0.3s ease;
    cursor: pointer;
    transform: translate3d(0, 0, 0);
    -webkit-transform: translate3d(0, 0, 0);
    will-change: transform, fill;
}

.view-3d .country {
    filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.2));
}

.country:hover, .country.hover {
    fill: rgba(176, 176, 176, 0.9);
}

.view-3d .country:hover, .view-3d .country.hover {
    transform: translateZ(5px);
    filter: drop-shadow(0 3px 3px rgba(0, 0, 0, 0.3));
}

.country.active {
    fill: #2196f3;
    stroke: #1976d2;
    stroke-width: 1;
}

.view-3d .country.active {
    transform: translateZ(8px);
    filter: drop-shadow(0 4px 4px rgba(0, 0, 0, 0.4));
}

.country.highlight {
    fill: rgba(33, 150, 243, 0.6);
    stroke: #2196f3;
    stroke-width: 1;
    filter: drop-shadow(0 0 5px rgba(33, 150, 243, 0.4));
}

/* Country Info Panel */
.country-info-panel {
    position: absolute;
    right: 30px;
    top: 30px;
    width: 320px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    z-index: 1000;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

.card {
    background: transparent;
    border: none;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.card-header {
    background: transparent;
    border-bottom: none;
    border-radius: 20px 20px 0 0 !important;
    padding: 1rem 1.2rem 0.5rem;
}

.card-header h3 {
    font-size: 1.8rem;
    font-weight: 300;
    color: #2196f3;
    margin: 0;
    letter-spacing: 0.5px;
}

.card-body {
    padding: 0.5rem 1.2rem 1rem;
    overflow-y: auto;
    flex: 1;
}

#country-population {
    font-size: 1.1rem;
    color: #666;
    margin: 0 0 0.8rem;
}

.flag-img {
    width: 32px;
    height: auto;
    border: 1px solid rgba(221, 221, 221, 0.5);
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

/* Buttons */
.country-details {
    display: flex;
    gap: 0.5rem;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.country-details button {
    flex: 1;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 15px;
    padding: 0.5rem 0.8rem;
    font-size: 1.1rem;
    color: #2196f3;
    font-weight: 300;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    white-space: nowrap;
}

.country-details button:hover {
    background: rgba(33, 150, 243, 0.1);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.country-details button.active {
    background: #2196f3;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(33, 150, 243, 0.3);
}

#detail-content {
    margin-top: 0.8rem;
    font-size: 1.1rem;
    line-height: 1.4;
    color: #444;
}

#detail-content h4 {
    color: #2196f3;
    font-size: 1.2rem;
    font-weight: 300;
    margin-bottom: 0.8rem;
}

#detail-content p {
    margin-bottom: 0.8rem;
}

#detail-content ul {
    padding-left: 1.2rem;
    margin-bottom: 0.8rem;
}

#detail-content li {
    margin-bottom: 0.4rem;
}

/* Zoom Controls */
.zoom-controls {
    min-width: 220px;
}

.zoom-hint {
    font-size: 0.9rem;
    color: #666;
    font-weight: 300;
    white-space: nowrap;
    text-shadow: 0 1px 1px rgba(255, 255, 255, 0.8);
}

.form-select {
    background-color: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 20px;
    padding: 0.7rem 2.5rem 0.7rem 1.2rem;
    font-size: 1.1rem;
    font-weight: 300;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    color: #2196f3;
    cursor: pointer;
    background-image: linear-gradient(45deg, transparent 50%, #2196f3 50%), 
                      linear-gradient(135deg, #2196f3 50%, transparent 50%);
    background-position: calc(100% - 20px) center, 
                         calc(100% - 15px) center;
    background-size: 5px 5px, 
                    5px 5px;
    background-repeat: no-repeat;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    transition: all 0.3s ease;
}

.form-select:hover {
    background-color: rgba(255, 255, 255, 1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.form-select:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.2);
}

/* Responsive Design */
@media (max-width: 768px) {
    .country-info-panel {
        width: calc(100% - 30px);
        right: 15px;
        top: auto;
        bottom: 15px;
        max-height: 50vh;
    }
    
    .zoom-controls {
        min-width: 140px;
    }
}

/* Flag Marker */
.flag-marker {
    fill: #2196f3;
    stroke: white;
    stroke-width: 2;
    cursor: pointer;
    transition: fill 0.3s ease;
}

.flag-marker:hover, .flag-group:hover .flag-marker {
    fill: #1976d2;
}

.flag-pole {
    fill: #555;
    stroke: none;
    transition: fill 0.3s ease;
}

.flag-group:hover .flag-pole {
    fill: #333;
}

/* Responsive Design */
@media (max-width: 768px) {
    .country-info-panel {
        width: calc(100% - 30px);
        right: 15px;
        top: auto;
        bottom: 15px;
        max-height: 50vh;
    }
    
    .zoom-controls {
        min-width: 140px;
    }
}

/* Flag Info Panel */
.location-item {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.location-item:hover {
    transform: translateY(-5px);
}

.location-item h4 {
    color: #2196f3;
    font-size: 1.2rem;
    font-weight: 300;
    margin-bottom: 10px;
}

.location-item img {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.3s ease;
}

.location-item:hover img {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* Search Bar */
.search-container {
    flex: 1;
    max-width: 400px;
}

.search-box {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
}

.search-box input {
    width: 100%;
    padding: 8px 40px 8px 16px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.8);
    background: rgba(255, 255, 255, 0.95);
    font-size: 1rem;
    color: #333;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.search-box input:focus {
    outline: none;
    border-color: #2196f3;
    box-shadow: 0 2px 15px rgba(33, 150, 243, 0.2);
}

.search-box input::placeholder {
    color: #999;
}

.search-btn {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    color: #2196f3;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.search-btn:hover {
    color: #1976d2;
    transform: scale(1.1);
} 