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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

header {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

h1 {
    color: #333;
    margin-bottom: 15px;
    font-size: 28px;
}

.location-controls {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.search-container {
    flex: 1;
    position: relative;
}

#locationSearch {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
}

#locationSearch:focus {
    outline: none;
    border-color: #667eea;
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 2px solid #e0e0e0;
    border-top: none;
    border-radius: 0 0 8px 8px;
    max-height: 300px;
    overflow-y: auto;
    display: none;
    z-index: 1000;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.search-results.show {
    display: block;
}

.search-result-item {
    padding: 12px 16px;
    cursor: pointer;
    transition: background-color 0.2s;
    border-bottom: 1px solid #f0f0f0;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background-color: #f5f5f5;
}

.location-btn {
    padding: 12px 16px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    white-space: nowrap;
}

.location-btn:hover {
    background: #5568d3;
}

.location-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.recent-searches {
    background: white;
    padding: 15px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    display: none;
}

.recent-searches.show {
    display: block;
}

.recent-searches h3 {
    font-size: 16px;
    color: #666;
    margin-bottom: 10px;
}

.carousel {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 5px 0;
}

.carousel-item {
    background: #f5f5f5;
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid transparent;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 250px;
}

.carousel-item:hover {
    background: #e8e8e8;
    border-color: #667eea;
}

.carousel-item.active {
    background: #667eea;
    color: white;
}

.carousel-minimap {
    width: 80px;
    height: 60px;
    border-radius: 4px;
    overflow: hidden;
    border: 2px solid #e0e0e0;
    flex-shrink: 0;
    background: #f0f0f0;
    position: relative;
}

.carousel-minimap::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid #ddd;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.carousel-item.active .carousel-minimap {
    border-color: rgba(255, 255, 255, 0.5);
}

.carousel-item-content {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.carousel-item-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.carousel-item-controls {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.carousel-item-btn {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #ddd;
    border-radius: 4px;
    width: 24px;
    height: 24px;
    padding: 0;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.carousel-item.active .carousel-item-btn {
    background: rgba(255, 255, 255, 0.95);
}

.carousel-item-btn:hover {
    background: white;
    transform: scale(1.1);
}

.delete-btn:hover {
    color: #c33;
    border-color: #c33;
}

.rename-btn:hover {
    color: #667eea;
    border-color: #667eea;
}

.current-location {
    background: white;
    padding: 15px 20px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    display: none;
    font-size: 18px;
    color: #333;
}

.current-location.show {
    display: block;
}

.loading {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

.forecast-container {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.forecast-header {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
}

.forecast-header-content {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.forecast-title {
    margin: 0;
    font-size: 24px;
    color: #333;
    flex: 1;
    min-width: 200px;
}

.forecast-scroll-wrapper {
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: #667eea #f0f0f0;
}

.forecast-scroll-wrapper::-webkit-scrollbar {
    height: 12px;
}

.forecast-scroll-wrapper::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 6px;
}

.forecast-scroll-wrapper::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 6px;
}

.forecast-scroll {
    display: flex;
    gap: 20px;
    min-width: min-content;
}

.forecast-segment {
    flex-shrink: 0;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}

.forecast-segment img {
    display: block;
    max-width: 100%;
    height: auto;
}

.segment-label {
    background: #667eea;
    color: white;
    padding: 8px 12px;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    position: relative;
}

.info-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 8px;
    cursor: pointer;
    opacity: 0.9;
    transition: all 0.2s;
    vertical-align: middle;
}

.info-icon:hover {
    opacity: 1;
    transform: scale(1.1);
}

.info-icon svg {
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}

.info-tooltip {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 8px;
    background: white;
    color: #333;
    padding: 16px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    width: 320px;
    max-width: 90vw;
    text-align: left;
    font-weight: normal;
    font-size: 13px;
    line-height: 1.5;
}

.info-tooltip.show {
    display: block;
}

.info-tooltip strong {
    color: #667eea;
    font-size: 14px;
}

.info-tooltip ul {
    margin: 8px 0;
    padding-left: 20px;
}

.info-tooltip li {
    margin: 4px 0;
}

/* Arrow for tooltip */
.info-tooltip::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 8px solid transparent;
    border-bottom-color: white;
}

.error-message {
    background: #fee;
    color: #c33;
    padding: 15px;
    border-radius: 8px;
    margin: 20px 0;
    border: 1px solid #fcc;
}

/* Map Modal */
.map-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    padding: 20px;
}

.map-modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.map-modal-content {
    background: white;
    border-radius: 12px;
    width: 100%;
    max-width: 900px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.map-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 2px solid #e0e0e0;
}

.map-modal-header h2 {
    margin: 0;
    color: #333;
    font-size: 22px;
}

.close-map-btn {
    background: none;
    border: none;
    font-size: 32px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.close-map-btn:hover {
    color: #333;
}

.map-instructions {
    padding: 15px 20px;
    background: #f5f5f5;
    margin: 0;
    color: #666;
    font-size: 14px;
}

.map-container {
    flex: 1;
    min-height: 500px;
    border-radius: 0 0 12px 12px;
    overflow: hidden;
}

/* Minimap */
.current-location {
    background: white;
    padding: 15px 20px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    display: none;
    font-size: 18px;
    color: #333;
}

.current-location.show {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.location-minimap {
    width: 150px;
    height: 100px;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid #e0e0e0;
    flex-shrink: 0;
}

.clickable-minimap {
    cursor: pointer;
    transition: all 0.2s;
}

.clickable-minimap:hover {
    border-color: #667eea;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
    transform: scale(1.02);
}

@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    h1 {
        font-size: 22px;
    }

    .location-controls {
        flex-direction: column;
    }

    .location-btn {
        width: 100%;
    }

    .map-modal {
        padding: 10px;
    }

    .map-container {
        min-height: 400px;
    }

    .current-location {
        flex-direction: column;
        align-items: flex-start;
    }

    .location-minimap {
        width: 100%;
        height: 150px;
    }
}
