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

:root {
    --ocean-blue: #0077be;
    --ocean-deep: #004e7c;
    --land-green: #228b22;
    --land-light: #4ade80;
    --sand: #f4e4bc;
    --navy: #1a1a2e;
    --coral: #ff6b6b;
    --gold: #ffd700;
}

body {
    font-family: 'Space Grotesk', sans-serif;
    background: linear-gradient(135deg, var(--ocean-deep) 0%, var(--ocean-blue) 50%, var(--land-green) 100%);
    min-height: 100vh;
    color: var(--navy);
}

.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

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

.header-content {
    max-width: 800px;
    margin: 0 auto;
}

.title {
    font-size: 2.5rem;
    font-weight: 800;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.globe-animation {
    display: inline-block;
    animation: spin 4s linear infinite;
}

.globe-animation.delay {
    animation-direction: reverse;
}

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

.subtitle {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.9);
    margin-top: 0.5rem;
    font-family: 'Crimson Pro', serif;
    font-style: italic;
}

.main-content {
    flex: 1;
    padding: 1.5rem;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

.search-section {
    max-width: 600px;
    margin: 0 auto 1.5rem;
    position: relative;
}

.search-container {
    display: flex;
    gap: 0.5rem;
    background: white;
    border-radius: 50px;
    padding: 0.5rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.search-input {
    flex: 1;
    border: none;
    padding: 1rem 1.5rem;
    font-size: 1rem;
    font-family: 'Space Grotesk', sans-serif;
    outline: none;
    border-radius: 50px;
    background: transparent;
}

.search-button {
    background: var(--ocean-blue);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 1.3rem;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
}

.search-button:hover {
    transform: scale(1.1);
    background: var(--ocean-deep);
}

.suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border-radius: 1rem;
    margin-top: 0.5rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    z-index: 1000;
}

.suggestion-item {
    padding: 1rem 1.5rem;
    cursor: pointer;
    border-bottom: 1px solid #eee;
    transition: background 0.2s;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.suggestion-item:hover {
    background: var(--sand);
}

.helper-text {
    text-align: center;
    color: rgba(255, 255, 255, 0.8);
    margin-top: 0.75rem;
    font-size: 0.9rem;
}

.map-container {
    background: white;
    border-radius: 1.5rem;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    position: relative;
}

.map {
    height: 50vh;
    min-height: 400px;
    width: 100%;
}

.marker-pin {
    font-size: 2rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    animation: bounce 0.5s ease-out;
}

@keyframes bounce {
    0% { transform: translateY(-20px); opacity: 0; }
    50% { transform: translateY(5px); }
    100% { transform: translateY(0); opacity: 1; }
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.loading-content {
    text-align: center;
    color: white;
}

.drill-animation {
    font-size: 4rem;
    animation: drill 0.5s ease-in-out infinite;
}

@keyframes drill {
    0%, 100% { transform: rotate(-15deg); }
    50% { transform: rotate(15deg); }
}

.loading-text {
    font-size: 1.3rem;
    margin: 1rem 0;
    font-family: 'Crimson Pro', serif;
}

.loading-bar {
    width: 200px;
    height: 8px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    margin: 0 auto;
    overflow: hidden;
}

.loading-progress {
    height: 100%;
    background: linear-gradient(90deg, var(--ocean-blue), var(--land-green));
    border-radius: 4px;
    animation: progress 1.5s ease-in-out infinite;
}

@keyframes progress {
    0% { width: 0%; }
    100% { width: 100%; }
}

.result-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-radius: 2rem 2rem 0 0;
    padding: 2rem;
    max-height: 80vh;
    overflow-y: auto;
    z-index: 1500;
    animation: slideUp 0.5s ease-out;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.2);
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.result-panel.ocean {
    background: linear-gradient(180deg, #e3f2fd 0%, white 100%);
}

.result-panel.land {
    background: linear-gradient(180deg, #e8f5e9 0%, white 100%);
}

.close-button {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: #666;
    transition: transform 0.2s;
}

.close-button:hover {
    transform: scale(1.2);
}

.result-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.result-type {
    font-size: 2.5rem;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.result-type.ocean {
    color: var(--ocean-blue);
}

.result-type.land {
    color: var(--land-green);
}

.rare-badge {
    font-size: 1rem;
    background: linear-gradient(45deg, #ffd700, #ff6b6b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.location-cards {
    display: flex;
    gap: 1rem;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.location-card {
    background: white;
    padding: 1.5rem;
    border-radius: 1rem;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    flex: 1;
    min-width: 200px;
    max-width: 300px;
}

.location-card h3 {
    font-size: 1rem;
    color: #666;
    margin-bottom: 0.5rem;
}

.location-name {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    word-break: break-word;
}

.ocean-name {
    color: var(--ocean-blue);
    font-size: 1.3rem;
}

.coords {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    color: #888;
}

.arrow {
    font-size: 2rem;
    animation: pulse 2s ease-in-out infinite;
}

.info-section {
    background: rgba(0, 0, 0, 0.03);
    padding: 1rem 1.5rem;
    border-radius: 1rem;
    margin-bottom: 1rem;
}

.info-section h4 {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0.5rem;
}

.info-section p {
    font-size: 1rem;
}

.info-section.fact {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeeba 100%);
}

.wildlife-section {
    margin-bottom: 1.5rem;
}

.wildlife-section h4 {
    font-size: 1rem;
    color: #666;
    margin-bottom: 0.75rem;
}

.wildlife-card {
    background: white;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.wildlife-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.wildlife-name {
    padding: 1rem;
    font-weight: 600;
    text-align: center;
}

.result-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.share-button {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, var(--coral) 0%, #ff8e8e 100%);
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    font-family: 'Space Grotesk', sans-serif;
}

.share-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(255, 107, 107, 0.4);
}

.reset-button {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, var(--ocean-blue) 0%, #4da6d9 100%);
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    font-family: 'Space Grotesk', sans-serif;
}

.reset-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 119, 190, 0.4);
}

.stats-bar {
    display: flex;
    justify-content: center;
    gap: 2rem;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.2);
    flex-wrap: wrap;
}

.stat {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: white;
    font-size: 0.9rem;
}

.stat-icon {
    font-size: 1.2rem;
}

.fun-fact {
    font-style: italic;
    opacity: 0.8;
}

.footer {
    text-align: center;
    padding: 1.5rem;
    background: rgba(0, 0, 0, 0.3);
    color: white;
}

.footer p {
    font-family: 'Crimson Pro', serif;
    font-style: italic;
    margin-bottom: 0.75rem;
}

.footer-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    font-size: 0.9rem;
}

.remix-link {
    color: var(--coral);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.remix-link:hover {
    color: #ff8e8e;
}

.separator {
    opacity: 0.5;
}

.confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 3000;
    overflow: hidden;
}

.confetti {
    position: absolute;
    top: -10px;
    width: 10px;
    height: 10px;
    border-radius: 2px;
    animation: fall 3s linear forwards;
}

@keyframes fall {
    0% { 
        transform: translateY(0) rotate(0deg); 
        opacity: 1; 
    }
    100% { 
        transform: translateY(100vh) rotate(720deg); 
        opacity: 0; 
    }
}

/* Leaflet overrides */
.leaflet-control-attribution {
    font-size: 10px !important;
}

@media (min-width: 768px) {
    .title {
        font-size: 3rem;
    }
    
    .result-panel {
        left: 50%;
        transform: translateX(-50%);
        max-width: 600px;
        bottom: 2rem;
        border-radius: 2rem;
        animation: slideUpDesktop 0.5s ease-out;
    }
    
    @keyframes slideUpDesktop {
        from { 
            transform: translateX(-50%) translateY(100%); 
            opacity: 0;
        }
        to { 
            transform: translateX(-50%) translateY(0); 
            opacity: 1;
        }
    }
    
    .map {
        height: 60vh;
    }
}

@media (max-width: 480px) {
    .title {
        font-size: 1.8rem;
    }
    
    .stats-bar {
        gap: 1rem;
        font-size: 0.8rem;
    }
    
    .stat {
        font-size: 0.8rem;
    }
    
    .fun-fact {
        display: none;
    }
    
    .location-cards {
        flex-direction: column;
    }
    
    .arrow {
        transform: rotate(90deg);
    }
    
    .location-card {
        max-width: 100%;
    }
}