/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Open Sans', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    overflow-x: hidden;
}

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

/* Header */
.header {
    text-align: center;
    padding: 20px 0;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.title {
    font-family: 'Fredoka One', cursive;
    font-size: 2.5rem;
    color: #fff;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    margin-bottom: 10px;
    animation: bounce 2s infinite;
}

.subtitle {
    color: #f0f8ff;
    font-size: 1.1rem;
    font-weight: 300;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

/* Globe Container */
.globe-container {
    position: relative;
    height: 70vh;
    min-height: 500px;
    max-height: 800px;
    margin: 20px auto;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    background: radial-gradient(circle at center, #1a1a2e, #16213e);
}

#globe-canvas {
    width: 100%;
    height: 100%;
    display: block;
    cursor: grab;
}

#globe-canvas:active {
    cursor: grabbing;
}

/* Loading Screen */
.loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: #fff;
    z-index: 100;
}

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

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

/* Controls */
.controls {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 10;
}

.control-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 15px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.control-btn:hover {
    background: #fff;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.control-btn.active {
    background: #4CAF50;
    color: #fff;
}

/* Zoom Instructions */
.zoom-instructions {
    position: absolute;
    bottom: 20px;
    left: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 10;
}

.instruction {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    backdrop-filter: blur(5px);
}

.icon {
    font-size: 1.2rem;
}

/* Information Panel */
.info-panel {
    position: absolute;
    top: 20px;
    left: 20px;
    width: 300px;
    max-height: 400px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    transition: all 0.3s ease;
    z-index: 20;
}

.info-panel.hidden {
    opacity: 0;
    transform: translateX(-100%);
    pointer-events: none;
}

.info-header {
    display: flex;
    justify-content: between;
    align-items: center;
    padding: 15px 20px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
}

.info-header h2 {
    font-family: 'Fredoka One', cursive;
    font-size: 1.3rem;
    flex-grow: 1;
}

.close-btn {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.3s ease;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.info-content {
    padding: 20px;
    max-height: 320px;
    overflow-y: auto;
}

/* 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;
    transition: opacity 0.3s ease;
}

.modal.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal-content {
    background: #fff;
    border-radius: 20px;
    max-width: 800px;
    max-height: 90vh;
    width: 90%;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: modalSlideIn 0.3s ease;
}

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

.modal-header {
    display: flex;
    justify-content: between;
    align-items: center;
    padding: 20px 30px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
}

.modal-header h2 {
    font-family: 'Fredoka One', cursive;
    font-size: 1.8rem;
    flex-grow: 1;
}

.modal-body {
    padding: 30px;
    max-height: 70vh;
    overflow-y: auto;
}

/* Continent Info */
.continent-info {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 30px;
    margin-bottom: 30px;
}

.continent-image img {
    width: 100%;
    border-radius: 15px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.continent-details h3 {
    color: #667eea;
    margin-bottom: 15px;
    font-family: 'Fredoka One', cursive;
}

.climate-zones {
    margin-bottom: 25px;
}

.climate-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.climate-zone {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 10px;
    border-left: 4px solid;
}

.climate-color {
    width: 20px;
    height: 20px;
    border-radius: 50%;
}

.fun-facts ul {
    list-style: none;
}

.fun-facts li {
    padding: 8px 0;
    border-bottom: 1px solid #eee;
    position: relative;
    padding-left: 25px;
}

.fun-facts li:before {
    content: "⭐";
    position: absolute;
    left: 0;
}

/* Countries Grid */
.countries-section h3 {
    color: #667eea;
    margin-bottom: 20px;
    font-family: 'Fredoka One', cursive;
}

.countries-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.country-card {
    padding: 15px;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    border: 2px solid transparent;
}

.country-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    border-color: #667eea;
}

.country-card h4 {
    color: #333;
    margin-bottom: 5px;
    font-family: 'Fredoka One', cursive;
}

/* Country Modal */
.country-info {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.country-section h3 {
    color: #667eea;
    margin-bottom: 15px;
    font-family: 'Fredoka One', cursive;
}

.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tag {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: 500;
    font-size: 0.9rem;
    animation: tagSlideIn 0.3s ease;
}

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

.fun-fact-text {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
    border-left: 4px solid #667eea;
    font-style: italic;
    font-size: 1.1rem;
    color: #555;
}

/* Climate Legend */
.climate-legend {
    position: absolute;
    bottom: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    z-index: 15;
    transition: all 0.3s ease;
}

.climate-legend.hidden {
    opacity: 0;
    transform: translateY(100%);
    pointer-events: none;
}

.climate-legend h3 {
    color: #667eea;
    margin-bottom: 15px;
    font-family: 'Fredoka One', cursive;
    text-align: center;
}

.legend-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* Footer */
.footer {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 30px 0;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    margin-top: 40px;
}

.footer h3 {
    color: #fff;
    font-family: 'Fredoka One', cursive;
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.resources {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
}

.resource-link {
    color: #f0f8ff;
    text-decoration: none;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 25px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.resource-link:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.footer-text {
    color: #f0f8ff;
    font-size: 1.1rem;
    font-weight: 300;
}

/* Responsive Design */
@media (max-width: 768px) {
    .title {
        font-size: 2rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .globe-container {
        height: 60vh;
        margin: 10px;
        border-radius: 15px;
    }
    
    .controls {
        top: 10px;
        right: 10px;
    }
    
    .control-btn {
        padding: 8px 12px;
        font-size: 0.8rem;
    }
    
    .zoom-instructions {
        bottom: 10px;
        left: 10px;
    }
    
    .instruction {
        padding: 6px 10px;
        font-size: 0.8rem;
    }
    
    .info-panel {
        width: calc(100% - 40px);
        left: 20px;
        top: 10px;
    }
    
    .continent-info {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .modal-content {
        width: 95%;
        max-height: 95vh;
    }
    
    .modal-body {
        padding: 20px;
    }
    
    .countries-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 10px;
    }
    
    .climate-legend {
        bottom: 10px;
        right: 10px;
        padding: 15px;
    }
    
    .resources {
        flex-direction: column;
        align-items: center;
    }
}

@media (max-width: 480px) {
    .title {
        font-size: 1.5rem;
    }
    
    .globe-container {
        height: 50vh;
    }
    
    .controls {
        flex-direction: row;
        top: auto;
        bottom: 10px;
        right: 10px;
        left: 10px;
        justify-content: space-between;
    }
    
    .control-btn {
        flex: 1;
        justify-content: center;
        padding: 10px 5px;
        font-size: 0.7rem;
    }
    
    .zoom-instructions {
        display: none;
    }
    
    .climate-legend {
        transform: scale(0.9);
        transform-origin: bottom right;
    }
}

/* Animation classes */
.fade-in {
    animation: fadeIn 0.5s ease;
}

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

.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(102, 126, 234, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(102, 126, 234, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(102, 126, 234, 0);
    }
}

/* Scrollbar Styles */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #764ba2;
}