:root {
    --primary-color: #0277bd;
    --light-bg: #f8fafc;
    --dark-text: #263238;
    --light-text: #78909c;
    --success: #4caf50;
    --warning: #ff9800;
    --danger: #f44336;
    --cold: #2196f3;
    --card-shadow: 0 2px 8px rgba(0,0,0,0.08);
    --border-radius: 12px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Roboto, Arial, sans-serif;
}

body {
    background-color: var(--light-bg);
    color: var(--dark-text);
    line-height: 1.5;
}

/* Navigation */
.nav-bar {
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    padding: 10px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 22px;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: opacity 0.3s;
}

.logo:hover {
    opacity: 0.8;
}

.logo-icon {
    font-size: 24px;
}

.nav-menu {
    display: flex;
    gap: 20px;
    align-items: center;
}

.nav-link {
    color: var(--dark-text);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    position: relative;
    transition: color 0.3s;
    white-space: nowrap;
}

.nav-link:hover {
    color: var(--primary-color);
}

/* Responsive navigation */
@media (max-width: 768px) {
    .nav-bar {
        padding: 8px 0;
    }

    .nav-container {
        padding: 0 12px;
    }

    .nav-menu {
        gap: 12px;
    }

    .nav-link {
        font-size: 13px;
    }

    .logo {
        font-size: 20px;
        gap: 6px;
    }

    .logo-icon {
        font-size: 22px;
    }
}

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

/* Loading and Error States */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loading-text {
    margin-top: 16px;
    font-size: 16px;
    color: var(--dark-text);
}

.error-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(244, 67, 54, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.error-content {
    background: white;
    padding: 32px;
    border-radius: var(--border-radius);
    text-align: center;
    max-width: 400px;
}

.retry-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    margin-top: 16px;
}

/* Beach Header */
.beach-header {
    position: relative;
    height: 280px;
    margin-bottom: 20px;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--card-shadow);
}

.beach-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.beach-info-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(to top, rgba(0,0,0,0.8), rgba(0,0,0,0));
    padding: 20px;
    color: white;
}

.beach-name {
    font-size: 28px;
    margin-bottom: 8px;
    font-weight: 600;
}

.beach-location {
    display: flex;
    align-items: center;
    font-size: 14px;
    margin-bottom: 10px;
    opacity: 0.9;
}

.weather-compact {
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 15px;
    margin-top: 12px;
}

.weather-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 12px;
    text-align: center;
}

.weather-item {
    display: flex;
    flex-direction: column;
}

.weather-value {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 2px;
}

.weather-label {
    font-size: 11px;
    opacity: 0.9;
}

.weather-sublabel {
    font-size: 9px;
    opacity: 0.7;
}

/* Safety Alerts */
.safety-alerts {
    position: absolute;
    top: 15px;
    left: 15px;
    right: 15px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.safety-alert {
    background: var(--danger);
    color: white;
    padding: 6px 10px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 500;
    backdrop-filter: blur(10px);
}

.safety-alert.warning {
    background: var(--warning);
}

.safety-alert.info {
    background: #2196f3;
}

/* Search Suggestions Dropdown */
.hero-search {
    position: relative;
    display: flex;
    align-items: center;
    max-width: 600px;
    margin: 0 auto;
}

.search-suggestions {
    position: absolute;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 9999;
    display: none;
    width: 100%;
    transition: opacity 0.2s ease-in-out;
    opacity: 0;
}

.search-suggestions.active {
    display: block;
    opacity: 1;
}

.suggestion-item {
    padding: 12px 16px;
    cursor: pointer;
    transition: background-color 0.2s;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    gap: 12px;
}

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

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

.suggestion-icon {
    font-size: 18px;
    min-width: 24px;
    text-align: center;
}

.suggestion-content {
    flex: 1;
    min-width: 0;
}

.suggestion-title {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.suggestion-subtitle {
    font-size: 12px;
    color: #666;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.suggestion-type {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 12px;
    background: #f0f0f0;
    color: #666;
    white-space: nowrap;
}

/* Scrollbar styling */
.search-suggestions::-webkit-scrollbar {
    width: 6px;
}

.search-suggestions::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.search-suggestions::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.search-suggestions::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.safety-alert.info {
    background: var(--cold);
}

/* Content Grid */
.content-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin-bottom: 25px;
}

.main-column {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.side-column {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Cards */
.card {
    background: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--card-shadow);
}

.card-header {
    background-color: var(--primary-color);
    color: white;
    padding: 12px 16px;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-subtitle {
    font-size: 12px;
    font-weight: normal;
    opacity: 0.8;
}

.card-body {
    padding: 16px;
}

.card-compact .card-body {
    padding: 12px;
}

.map-card-body {
    padding: 0 !important;
}

/* AI Summary */
.ai-summary {
    background: linear-gradient(135deg, rgba(33, 150, 243, 0.05), rgba(76, 175, 80, 0.05));
    border-left: 4px solid var(--primary-color);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-size: 14px;
    line-height: 1.6;
}

.main-tip {
    background: rgba(76, 175, 80, 0.1);
    padding: 10px;
    border-radius: 6px;
    border-left: 3px solid var(--success);
    margin-bottom: 10px;
}

.ai-update-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    font-size: 11px;
    color: var(--light-text);
}

/* Activities */
.activities-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
}

.activity-card {
    background: white;
    border: 2px solid #f0f0f0;
    border-radius: 10px;
    padding: 12px;
    text-align: center;
    transition: all 0.3s;
    cursor: pointer;
}

.activity-card.excellent {
    border-color: var(--success);
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.05), rgba(76, 175, 80, 0.1));
}

.activity-card.good {
    border-color: #8bc34a;
    background: linear-gradient(135deg, rgba(139, 195, 74, 0.05), rgba(139, 195, 74, 0.1));
}

.activity-card.warning {
    border-color: var(--warning);
    background: linear-gradient(135deg, rgba(255, 152, 0, 0.05), rgba(255, 152, 0, 0.1));
}

.activity-card.danger {
    border-color: var(--danger);
    background: linear-gradient(135deg, rgba(244, 67, 54, 0.05), rgba(244, 67, 54, 0.1));
}

.activity-card.cold {
    border-color: var(--cold);
    background: linear-gradient(135deg, rgba(33, 150, 243, 0.05), rgba(33, 150, 243, 0.1));
}

.activity-card.selected {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(2, 119, 189, 0.3);
    border-color: var(--primary-color);
    border-width: 3px;
}

.activity-card:hover {
    transform: scale(1.02);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.activity-icon {
    font-size: 24px;
    margin-bottom: 6px;
    display: block;
}

.activity-name {
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 4px;
}

.activity-status {
    padding: 2px 6px;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

.activity-status.excellent { background: var(--success); color: white; }
.activity-status.good { background: #8bc34a; color: white; }
.activity-status.warning { background: var(--warning); color: white; }
.activity-status.danger { background: var(--danger); color: white; }
.activity-status.cold { background: var(--cold); color: white; }

.activity-detail {
    font-size: 9px;
    color: var(--light-text);
    margin-top: 2px;
}

/* Activity Timeline */
.activity-timeline {
    margin-top: 15px;
    padding: 12px;
    background: rgba(0,0,0,0.02);
    border-radius: 8px;
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.timeline-title {
    font-size: 13px;
    font-weight: 500;
    color: var(--primary-color);
}

.timeline-recommendation {
    font-size: 11px;
    color: var(--light-text);
}

.activity-params {
    background: rgba(0,0,0,0.02);
    padding: 8px;
    border-radius: 6px;
    margin-bottom: 10px;
    font-size: 11px;
}

.params-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 8px;
}

.timeline-container {
    margin-top: 10px;
}

.timeline-hours {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 2px;
    margin-bottom: 8px;
}

.timeline-hour {
    text-align: center;
    font-size: 9px;
    color: var(--light-text);
}

.timeline-slots {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 2px;
    margin-bottom: 8px;
}

.timeline-slot {
    height: 20px;
    border-radius: 2px;
    position: relative;
    cursor: pointer;
}

.timeline-slot.excellent { background: var(--success); }
.timeline-slot.good { background: #8bc34a; }
.timeline-slot.warning { background: var(--warning); }
.timeline-slot.danger { background: var(--danger); }
.timeline-slot.cold { background: var(--cold); }

.timeline-legend {
    display: flex;
    gap: 12px;
    font-size: 10px;
    color: var(--light-text);
}

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

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 2px;
}

.legend-color.excellent { background: var(--success); }
.legend-color.good { background: #8bc34a; }
.legend-color.warning { background: var(--warning); }
.legend-color.danger { background: var(--danger); }
.legend-color.cold { background: var(--cold); }

/* Stats */
.stats-compact {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 15px;
}

.stat-compact {
    text-align: center;
    padding: 10px;
    background: rgba(0,0,0,0.02);
    border-radius: 8px;
}

.stat-value {
    font-size: 16px;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 2px;
}

.stat-label {
    font-size: 10px;
    color: var(--light-text);
    text-transform: uppercase;
}

/* Marine Data */
.marine-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.marine-section {
    padding: 12px;
    background: rgba(0,0,0,0.02);
    border-radius: 8px;
}

.marine-title {
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 8px;
}

.marine-content {
    font-size: 12px;
    line-height: 1.4;
}

/* Tabs */
.tabs {
    display: flex;
    border-bottom: 1px solid #e0e0e0;
    margin-bottom: 12px;
}

.tab {
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    font-size: 13px;
    color: var(--light-text);
}

.tab.active {
    border-bottom-color: var(--primary-color);
    color: var(--primary-color);
    font-weight: 500;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Rating */
.beach-rating {
    background: rgba(255, 193, 7, 0.1);
    border-radius: 10px;
    padding: 15px;
    text-align: center;
}

.rating-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 10px;
}

.rating-stars {
    font-size: 24px;
    color: #ffc107;
}

.rating-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary-color);
}

.rating-count {
    font-size: 12px;
    color: var(--light-text);
    margin-bottom: 10px;
}

.rate-section {
    margin-top: 10px;
}

.rate-label {
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 8px;
}

.rate-buttons {
    display: flex;
    gap: 5px;
    justify-content: center;
    margin-bottom: 10px;
}

.rate-btn {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 2px;
    transition: transform 0.2s;
}

.rate-btn:hover {
    transform: scale(1.2);
}

.rate-btn.active {
    color: #ffc107;
}

.rating-feedback {
    font-size: 11px;
    color: var(--light-text);
    margin-top: 8px;
}

/* Week Forecast */
.week-forecast {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
}

.forecast-day {
    text-align: center;
    padding: 8px 4px;
    border-radius: 6px;
    background: rgba(0,0,0,0.02);
}

.forecast-day.today {
    background: rgba(2, 119, 189, 0.1);
    border: 1px solid var(--primary-color);
}

.forecast-date {
    font-size: 11px;
    color: var(--light-text);
    margin-bottom: 4px;
}

.forecast-icon {
    font-size: 20px;
    margin: 4px 0;
}

.forecast-temps {
    font-size: 11px;
}

.temp-max {
    font-weight: 600;
    color: var(--dark-text);
}

.temp-min {
    color: var(--light-text);
}

.forecast-water {
    font-size: 10px;
    color: var(--cold);
    font-weight: 500;
}

.forecast-tip {
    font-size: 11px;
    color: var(--light-text);
    text-align: center;
    margin-top: 8px;
}

/* Map */
.map-container {
    height: 200px;
    border-radius: 8px;
    overflow: hidden;
}

#map-osm {
    height: 100%;
    width: 100%;
}

/* Recommendations */
.recommendations {
    font-size: 13px;
    line-height: 1.5;
}

.recommendation-item {
    padding: 8px;
    border-radius: 6px;
    margin-bottom: 8px;
    border-left: 3px solid;
}

.recommendation-item.safety {
    background: rgba(244, 67, 54, 0.1);
    border-left-color: var(--danger);
}

.recommendation-item.clothing {
    background: rgba(33, 150, 243, 0.1);
    border-left-color: var(--cold);
}

.recommendation-item.activities {
    background: rgba(76, 175, 80, 0.1);
    border-left-color: var(--success);
}

/* Infrastructure */
.infrastructure-list {
    display: grid;
    gap: 6px;
    font-size: 12px;
}

.infrastructure-item {
    display: flex;
    align-items: center;
    padding: 4px 0;
}

.infrastructure-icon {
    margin-right: 8px;
}

.infrastructure-name {
    flex: 1;
}

.infrastructure-distance {
    color: var(--light-text);
    font-size: 11px;
}

/* Description */
.description-content {
    font-size: 14px;
    line-height: 1.6;
}

.description-preview {
    max-height: 60px;
    overflow: hidden;
    position: relative;
}

.read-more {
    color: var(--primary-color);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    margin-top: 8px;
}

/* Refresh Button */
.refresh-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 25px;
    font-size: 14px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transition: all 0.3s;
    z-index: 1000;
}

.refresh-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(0,0,0,0.2);
}

/* Notifications */
.notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
}

.notification {
    background: var(--primary-color);
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    margin-bottom: 10px;
    animation: slideIn 0.3s ease;
}

.notification.success {
    background: var(--success);
}

.notification.warning {
    background: var(--warning);
}

.notification.error {
    background: var(--danger);
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideOut {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}

/* Responsive Design */
@media (max-width: 768px) {
    .beach-header {
        height: 180px;  /* Reduced for tablet/mobile */
    }

    .beach-name {
        font-size: 22px !important;
    }

    .beach-info-overlay {
        padding: 15px !important;
    }

    .content-grid {
        grid-template-columns: 1fr;
    }

    .weather-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .stats-compact {
        grid-template-columns: repeat(2, 1fr);
    }

    .week-forecast {
        grid-template-columns: repeat(4, 1fr);
    }

    .activities-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .timeline-hours, .timeline-slots {
        grid-template-columns: repeat(8, 1fr);
    }

    .timeline-legend {
        flex-wrap: wrap;
        gap: 8px;
    }

    .marine-grid {
        grid-template-columns: 1fr;
    }

    .container {
        padding: 15px 10px;  /* Reduced padding on mobile */
    }

    .card {
        margin-bottom: 12px;  /* Tighter spacing */
    }
}

@media (max-width: 480px) {
    .beach-header {
        height: auto;  /* Auto height to fit all content */
        min-height: 240px;  /* Increased for better content visibility */
        margin-bottom: 15px;
    }

    .beach-name {
        font-size: 22px !important;
        line-height: 1.3;
        margin-bottom: 6px;
        text-shadow: 0 2px 8px rgba(0,0,0,0.5);
    }

    .beach-location {
        font-size: 13px !important;
        margin-bottom: 10px;
        text-shadow: 0 1px 4px rgba(0,0,0,0.5);
    }

    .beach-info-overlay {
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        padding: 15px !important;
        background: linear-gradient(to top, rgba(0,0,0,0.85), rgba(0,0,0,0.3) 60%, transparent);
    }

    /* Mobile compact weather - show only 3 most important */
    .weather-compact {
        display: block !important;
        background: rgba(255,255,255,0.2) !important;
        backdrop-filter: blur(8px);
        padding: 10px 8px !important;
        margin-top: 10px;
    }

    .weather-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 8px !important;
    }

    /* Show only first 3 items: Air, Water, Wind */
    .weather-item:nth-child(n+4) {
        display: none !important;
    }

    .weather-item {
        padding: 8px 4px !important;
        background: rgba(255,255,255,0.1);
        border-radius: 8px;
    }

    .weather-value {
        font-size: 18px !important;
        font-weight: 700;
    }

    .weather-label {
        font-size: 10px !important;
        text-transform: uppercase;
    }

    .weather-sublabel {
        font-size: 9px !important;
    }

    .activities-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .week-forecast {
        grid-template-columns: repeat(3, 1fr);
    }

    .safety-alerts {
        font-size: 11px !important;
        padding: 6px 10px !important;
        top: 10px;
        right: 10px;
        backdrop-filter: blur(4px);
    }

    .suggest-name-btn {
        font-size: 11px !important;
        padding: 5px 10px !important;
    }

    .card {
        border-radius: 10px;
    }

    .card-header {
        font-size: 16px !important;
        padding: 12px 15px;
    }

    .card-body {
        padding: 15px;
    }
}

/* Very small screens - alternative layout */
@media (max-width: 380px) {
    .beach-header {
        height: auto !important;
        min-height: auto !important;
        background: white !important;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
        padding: 15px;
        margin-bottom: 15px;
        border-radius: 12px;
    }

    .beach-image {
        display: none !important;  /* Hide image on very small screens */
    }

    .beach-info-overlay {
        position: relative !important;
        background: none !important;
        padding: 0 !important;
        color: #212529 !important;
    }

    .beach-name {
        color: #212529 !important;
        text-shadow: none !important;
        font-size: 20px !important;
    }

    .beach-location {
        color: #6c757d !important;
        text-shadow: none !important;
    }

    .weather-compact {
        background: #f8f9fa !important;
        padding: 12px !important;
        border-radius: 10px;
        margin-top: 12px;
    }

    .weather-item {
        background: white !important;
    }

    .weather-value {
        color: #212529 !important;
    }

    .weather-label {
        color: #6c757d !important;
    }

    .safety-alerts {
        position: relative !important;
        top: auto !important;
        right: auto !important;
        margin-bottom: 10px;
    }

    .suggest-name-btn {
        background: #f8f9fa !important;
        color: #495057 !important;
        border: 1px solid #dee2e6 !important;
    }
}

/* Дополнительные стили для новой логики загрузки */

/* Улучшенный спиннер загрузки с прогресс баром */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    backdrop-filter: blur(5px);
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #e3f2fd;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

.loading-text {
    font-size: 16px;
    color: var(--dark-text);
    margin-bottom: 15px;
    text-align: center;
    max-width: 300px;
}

.progress-container {
    width: 250px;
    margin-top: 10px;
}

.progress-background {
    width: 100%;
    height: 6px;
    background: #e0e0e0;
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), #4caf50);
    border-radius: 3px;
    width: 0%;
    transition: width 0.3s ease;
    position: relative;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shimmer 1.5s infinite;
}

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

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Предупреждение о частичных данных */
.partial-data-warning {
    position: fixed;
    top: 70px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    animation: slideDown 0.3s ease;
}

.warning-content {
    background: linear-gradient(135deg, #ff9800, #f57c00);
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(255, 152, 0, 0.3);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    max-width: 400px;
}

.warning-content button {
    background: none;
    border: none;
    color: white;
    font-size: 16px;
    cursor: pointer;
    padding: 0;
    margin-left: auto;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.warning-content button:hover {
    opacity: 1;
}

@keyframes slideDown {
    from {
        transform: translateX(-50%) translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

/* Улучшенные уведомления */
.notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1500;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.notification {
    background: white;
    border-radius: 8px;
    padding: 12px 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    font-size: 14px;
    max-width: 300px;
    position: relative;
    overflow: hidden;
    animation: slideIn 0.3s ease;
}

.notification::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
}

.notification.info::before {
    background: var(--primary-color);
}

.notification.success::before {
    background: var(--success);
}

.notification.warning::before {
    background: var(--warning);
}

.notification.error::before {
    background: var(--danger);
}

.notification.info {
    border-left: 4px solid var(--primary-color);
}

.notification.success {
    border-left: 4px solid var(--success);
}

.notification.warning {
    border-left: 4px solid var(--warning);
}

.notification.error {
    border-left: 4px solid var(--danger);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Улучшенная кнопка обновления */
.refresh-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 25px;
    font-size: 14px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 8px;
}

.refresh-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
    background: #0266a3;
}

.refresh-btn:active {
    transform: scale(0.98);
}

.refresh-btn.updating {
    background: var(--warning);
    cursor: not-allowed;
}

.refresh-btn.updating::before {
    content: '⏳';
    margin-right: 5px;
}

/* Статус индикаторы для данных */
.data-status-indicator {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    transition: all 0.3s;
}

.data-status-indicator.ready {
    background: var(--success);
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.3);
}

.data-status-indicator.updating {
    background: var(--warning);
    box-shadow: 0 0 0 2px rgba(255, 152, 0, 0.3);
    animation: pulse 1.5s infinite;
}

.data-status-indicator.error {
    background: var(--danger);
    box-shadow: 0 0 0 2px rgba(244, 67, 54, 0.3);
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.7; }
}

/* Улучшенные карточки с индикаторами состояния */
.card.has-status {
    position: relative;
}

.card.has-status::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border-radius: calc(var(--border-radius) + 2px);
    background: linear-gradient(45deg, transparent, transparent);
    z-index: -1;
    transition: all 0.3s;
}

.card.updating::after {
    background: linear-gradient(45deg, var(--warning), transparent, var(--warning));
    animation: borderGlow 2s infinite;
}

.card.ready::after {
    background: linear-gradient(45deg, var(--success), transparent, var(--success));
}

@keyframes borderGlow {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.6; }
}

/* Улучшенная анимация для активностей */
.activity-card.loading {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.activity-card.loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: loadingShimmer 1.5s infinite;
    border-radius: 10px;
}

@keyframes loadingShimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Responsive улучшения */
@media (max-width: 768px) {
    .notification-container {
        top: 10px;
        right: 10px;
        left: 10px;
    }
    
    .notification {
        max-width: none;
    }
    
    .partial-data-warning {
        left: 10px;
        right: 10px;
        transform: none;
    }
    
    .warning-content {
        max-width: none;
    }
    
    .refresh-btn {
        bottom: 10px;
        right: 10px;
        padding: 10px 16px;
        font-size: 13px;
    }
    
    .loading-text {
        font-size: 14px;
        max-width: 250px;
    }
    
    .progress-container {
        width: 200px;
    }
}

/* Дополнительные утилиты */
.fade-in {
    animation: fadeIn 0.5s ease;
}

.fade-out {
    animation: fadeOut 0.3s ease;
}

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

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

.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton 1.5s infinite;
}

@keyframes skeleton {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
/* Добавьте эти стили в styles.css */

/* Подсветка текущего часа */
.timeline-slot.current-hour {
    position: relative;
    box-shadow: 0 0 10px rgba(2, 119, 189, 0.5);
    transform: scale(1.1);
    z-index: 2;
}

.timeline-slot.current-hour::after {
    content: '●';
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--primary-color);
    font-size: 8px;
}

/* Стили для детальной информации активности */
.activity-detail {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 4px;
}

.activity-detail .score {
    font-size: 10px;
    font-weight: 600;
    color: var(--light-text);
}

.activity-detail .quality-indicator {
    font-size: 12px;
    margin-left: 4px;
}

/* Улучшенная сетка параметров */
.params-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    font-size: 12px;
    line-height: 1.4;
}

.params-grid > div {
    background: rgba(0,0,0,0.02);
    padding: 8px;
    border-radius: 6px;
    border-left: 3px solid var(--primary-color);
}

/* Анимация для выбранной активности */
.activity-card.selected {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(2, 119, 189, 0.3);
    border-color: var(--primary-color);
    border-width: 3px;
    transition: all 0.3s ease;
}

/* Индикатор загрузки для временной шкалы */
.timeline-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    font-size: 12px;
    color: var(--light-text);
}

.timeline-loading::before {
    content: '⏳';
    margin-right: 8px;
    animation: spin 2s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Улучшенные всплывающие подсказки для временной шкалы */
.timeline-slot {
    position: relative;
    cursor: pointer;
}

.timeline-slot:hover {
    transform: scale(1.1);
    z-index: 1;
    transition: transform 0.2s ease;
}

/* Стили для ошибок загрузки */
.timeline-error {
    text-align: center;
    padding: 20px;
    color: var(--danger);
    font-size: 12px;
}

.timeline-error::before {
    content: '⚠️';
    display: block;
    font-size: 24px;
    margin-bottom: 8px;
}

/* Улучшенная легенда */
.timeline-legend {
    display: flex;
    gap: 12px;
    margin-top: 12px;
    font-size: 10px;
    color: var(--light-text);
    justify-content: center;
    flex-wrap: wrap;
}

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

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 2px;
}
/* Стили для новых элементов */
.daily-summary-badge {
    background: linear-gradient(135deg, #4caf50, #8bc34a);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    margin-left: 8px;
}

.hour-detail-badge {
    background: linear-gradient(135deg, #2196f3, #03a9f4);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    margin-left: 8px;
}

.mode-toggle-btn {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #e0e0e0;
    border-radius: 16px;
    padding: 4px 12px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s;
    margin-left: auto;
}

.mode-toggle-btn:hover {
    background: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.timeline-slot.selected-hour {
    border: 2px solid var(--primary-color);
    transform: scale(1.1);
    z-index: 3;
    box-shadow: 0 0 12px rgba(2, 119, 189, 0.4);
}

.timeline-slot.hover-hour {
    transform: scale(1.05);
    transition: transform 0.2s;
    cursor: pointer;
}

.timeline-slot {
    transition: all 0.2s ease;
    cursor: pointer;
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

@media (max-width: 768px) {
    .daily-summary-badge, .hour-detail-badge {
        font-size: 10px;
        padding: 1px 6px;
    }
    
    .mode-toggle-btn {
        font-size: 10px;
        padding: 3px 8px;
    }
}
/* Стили для морских данных - добавить в styles.css */

.marine-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.marine-section {
    margin-bottom: 20px;
}

.marine-section-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.marine-item {
    background: rgba(0,0,0,0.02);
    border-radius: 8px;
    padding: 10px;
    text-align: center;
    border: 1px solid rgba(0,0,0,0.05);
}

.marine-label {
    font-size: 11px;
    color: var(--light-text);
    text-transform: uppercase;
    margin-bottom: 4px;
    font-weight: 500;
}

.marine-value {
    font-size: 16px;
    font-weight: 600;
    color: var(--dark-text);
    margin-bottom: 2px;
}

.marine-description {
    font-size: 10px;
    color: var(--light-text);
    line-height: 1.2;
}

.safety-warnings {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.safety-warning {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    border-left: 3px solid;
}

.safety-warning.danger {
    background: rgba(244, 67, 54, 0.1);
    border-left-color: var(--danger);
    color: #d32f2f;
}

.safety-warning.warning {
    background: rgba(255, 152, 0, 0.1);
    border-left-color: var(--warning);
    color: #f57c00;
}

.safety-warning.safe {
    background: rgba(76, 175, 80, 0.1);
    border-left-color: var(--success);
    color: #388e3c;
}

.warning-icon {
    font-size: 14px;
    flex-shrink: 0;
}

.warning-text {
    flex: 1;
    line-height: 1.3;
}

/* Адаптивность для морских данных */
@media (max-width: 768px) {
    .marine-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .marine-item {
        padding: 8px;
    }
    
    .marine-value {
        font-size: 14px;
    }
    
    .safety-warning {
        padding: 6px 10px;
        font-size: 11px;
    }
}

/* Анимации для морских элементов */
.marine-item {
    transition: all 0.2s ease;
}

.marine-item:hover {
    background: rgba(2, 119, 189, 0.05);
    border-color: rgba(2, 119, 189, 0.2);
    transform: translateY(-1px);
}

/* Стили для часовых слотов с взаимодействием */
.timeline-slot {
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.timeline-slot:hover {
    transform: scale(1.1);
    z-index: 2;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.timeline-slot.selected-hour {
    border: 2px solid var(--primary-color);
    box-shadow: 0 0 0 2px rgba(2, 119, 189, 0.3);
    transform: scale(1.05);
}

.timeline-slot.hover-hour {
    opacity: 0.8;
    transform: scale(1.03);
}

.timeline-slot.current-hour {
    border: 2px solid var(--primary-color);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(2, 119, 189, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(2, 119, 189, 0); }
    100% { box-shadow: 0 0 0 0 rgba(2, 119, 189, 0); }
}

/* Стили для кнопки переключения режима */
.mode-toggle-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
}

.mode-toggle-btn:hover {
    background: #0277bd;
    transform: scale(1.05);
}

/* Стили для бейджей в заголовках активностей */
.daily-summary-badge {
    background: rgba(76, 175, 80, 0.2);
    color: #388e3c;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 500;
    text-transform: uppercase;
}

.hour-detail-badge {
    background: rgba(2, 119, 189, 0.2);
    color: var(--primary-color);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 500;
}

/* Улучшенные стили для активностей */
.activity-detail {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 10px;
    margin-top: 4px;
}

.activity-detail .score {
    color: var(--light-text);
    font-weight: 500;
}

.quality-indicator {
    font-size: 12px;
}

/* Стили для прогресса загрузки */
.progress-container {
    width: 100%;
    margin-top: 15px;
}

.progress-background {
    width: 100%;
    height: 4px;
    background: rgba(255,255,255,0.3);
    border-radius: 2px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: var(--primary-color);
    border-radius: 2px;
    transition: width 0.3s ease;
    width: 0%;
}

/* Стили для предупреждения о частичных данных */
.partial-data-warning {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 152, 0, 0.95);
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 1000;
    max-width: 400px;
    animation: slideInFromTop 0.3s ease;
}

.warning-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    font-size: 14px;
}

.warning-content button {
    background: none;
    border: none;
    color: white;
    font-size: 16px;
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.warning-content button:hover {
    background: rgba(255,255,255,0.2);
}

@keyframes slideInFromTop {
    from {
        transform: translate(-50%, -100%);
        opacity: 0;
    }
    to {
        transform: translate(-50%, 0);
        opacity: 1;
    }
}

/* Добавить в styles.css */

/* Фиксированная высота для морского графика */
.marine-chart-container {
    height: 200px !important;
    max-height: 200px !important;
    min-height: 200px !important;
    width: 100%;
    position: relative;
    overflow: hidden;
    margin-bottom: 20px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    background: white;
}

.marine-chart-container canvas {
    width: 100% !important;
    height: 200px !important;
    max-height: 200px !important;
    min-height: 200px !important;
    display: block;
}

/* Убеждаемся что обычный график тоже имеет фиксированную высоту */
#hourlyChart {
    height: 200px !important;
    max-height: 200px !important;
    min-height: 200px !important;
    width: 100% !important;
}

/* Общие стили для всех canvas графиков */
.tab-content canvas {
    height: 200px !important;
    max-height: 200px !important;
    width: 100% !important;
    display: block;
}

/* Контейнер вкладки морские */
#marine-content {
    overflow: hidden;
    max-height: none;
    height: auto;
}

/* Убираем возможные конфликты */
.marine-grid {
    clear: both;
    overflow: visible;
}

/* Мобильная версия */
@media (max-width: 768px) {
    .marine-chart-container {
        height: 180px !important;
        max-height: 180px !important;
        min-height: 180px !important;
    }
    
    .marine-chart-container canvas {
        height: 180px !important;
        max-height: 180px !important;
        min-height: 180px !important;
    }
}

.legend-color.excellent { background: var(--success); }
.legend-color.good { background: #8bc34a; }
.legend-color.warning { background: var(--warning); }
.legend-color.danger { background: var(--danger); }
.legend-color.cold { background: var(--cold); }