/**
 * SurfCaptain Compatibility CSS
 * Styles for SurfCaptain-compatible structure (#fcst, #fcst-current, #fcst-timeline)
 */

/* ============================================================================
   Foundation Grid Framework (lightweight)
   ============================================================================ */

.grid-x {
    display: flex;
    flex-flow: row wrap;
}

.cell {
    flex: 0 0 auto;
    min-height: 0;
    min-width: 0;
    width: 100%;
}

.cell.auto {
    flex: 1 1 0;
}

.cell.shrink {
    flex: 0 0 auto;
}

/* Small screens */
.cell.small-12 {
    width: 100%;
}

/* Medium screens and up */
@media (min-width: 640px) {
    .cell.medium-5 {
        width: 41.66667%;
    }
    .cell.medium-7 {
        width: 58.33333%;
    }
    .cell.medium-12 {
        width: 100%;
    }
}

/* Large screens and up */
@media (min-width: 1024px) {
    .cell.large-3 {
        width: 25%;
    }
    .cell.large-6 {
        width: 50%;
    }
    .cell.large-9 {
        width: 75%;
    }
}

/* ============================================================================
   Section: Current Conditions (#fcst-current)
   ============================================================================ */

#fcst-current {
    margin-bottom: 2rem;
}

.fcst-current-header {
    margin-bottom: 1.5rem;
    padding: 1rem 0;
}

.fcst-current-header .grid-x {
    align-items: center;
    gap: 1rem;
}

.fcst-current-cond {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.fcst-current-cond.clean {
    background-color: #10b981;
}

.fcst-current-cond.fair {
    background-color: #3b82f6;
}

.fcst-current-cond.choppy {
    background-color: #ef4444;
}

#fcst-current-title {
    font-size: 1.75rem;
    font-weight: 600;
    line-height: 1.3;
    margin: 0;
    color: #111827;
}

#fcst-current-title span {
    display: inline;
}

/* Current Data Cards (ul/li structure) */
#fcst-current-data {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.fcst-current-item {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 1rem;
    transition: all 0.2s ease;
}

.fcst-current-item:hover {
    background: #fff;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.current-data-container {
    align-items: center;
    gap: 1rem;
}

.current-data-icon {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

/* Icon placeholders (will be replaced with actual icons) */
.current-data-icon.wx-icon {
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%232196F3"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"/></svg>');
}

.current-data-icon.tide-icon {
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%2310b981"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"/></svg>');
}

.current-data-icon.buoy-icon {
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23ef4444"><circle cx="12" cy="12" r="8"/></svg>');
}

.current-data-icon.water-icon {
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23f59e0b"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"/></svg>');
}

.current-data-info {
    flex: 1;
}

.current-data-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.current-data-desc {
    font-size: 1.125rem;
    font-weight: 600;
    color: #111827;
}

.current-data-link {
    margin-top: 0.5rem;
}

.current-data-button {
    background: transparent;
    border: none;
    color: #2196F3;
    font-size: 0.875rem;
    cursor: pointer;
    padding: 0;
    text-decoration: none;
}

.current-data-button:hover {
    text-decoration: underline;
}

.wetsuit {
    font-size: 0.875rem;
    color: #6b7280;
}

/* ============================================================================
   Section: Timeline (#fcst-timeline)
   ============================================================================ */

#fcst-timeline {
    margin: 2rem 0;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    padding: 1.5rem;
}

.fcst-timeline-header {
    margin-bottom: 1.5rem;
    align-items: center;
}

#timeline-header-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #111827;
    margin: 0;
}

.timeline-toggle {
    display: flex;
    justify-content: flex-end;
}

.timeline-toggle .grid-x {
    gap: 1rem;
    align-items: center;
}

/* Surf/Swell Toggle */
.timeline-toggle-surfswell {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #6b7280;
}

.toggle-surf-label,
.toggle-swell-label {
    cursor: pointer;
    transition: color 0.2s;
}

.toggle-surf-label.active,
.toggle-swell-label.active {
    color: #2196F3;
    font-weight: 600;
}

.surfswell-toggle {
    position: relative;
    width: 40px;
    height: 20px;
    background: #e5e7eb;
    border-radius: 10px;
    cursor: pointer;
}

.surf-toggle,
.swell-toggle {
    position: absolute;
    top: 2px;
    width: 16px;
    height: 16px;
    background: #fff;
    border-radius: 50%;
    transition: left 0.2s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.surf-toggle.active {
    left: 2px;
    background: #2196F3;
}

.swell-toggle {
    left: 22px;
}

.swell-toggle.active {
    background: #2196F3;
}

/* Days Toggle */
.timeline-toggle-days {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #6b7280;
}

.toggle-day3-label,
.toggle-day16-label {
    cursor: pointer;
    transition: color 0.2s;
}

.toggle-day3-label.active,
.toggle-day16-label.active {
    color: #2196F3;
    font-weight: 600;
}

.days-toggle {
    position: relative;
    width: 40px;
    height: 20px;
    background: #e5e7eb;
    border-radius: 10px;
    cursor: pointer;
}

.day3-toggle,
.day16-toggle {
    position: absolute;
    top: 2px;
    width: 16px;
    height: 16px;
    background: #fff;
    border-radius: 50%;
    transition: left 0.2s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.day3-toggle.active {
    left: 2px;
    background: #2196F3;
}

.day16-toggle {
    left: 22px;
}

.day16-toggle.active {
    background: #2196F3;
}

/* Timeline Chart */
.fcst-timeline {
    margin: 1rem 0;
}

/* Timeline Graph Data (compass and details below chart) */
.timeline-graph-data {
    margin-top: 1.5rem;
}

.timeline-graph-data-contents {
    background: #f9fafb;
    border-radius: 0.5rem;
    padding: 1rem;
}

#timeline-graph-details {
    gap: 1.5rem;
}

.timeline-details-tide {
    padding: 1rem;
}

/* ============================================================================
   Responsive Design
   ============================================================================ */

@media (max-width: 768px) {
    #fcst-current-title {
        font-size: 1.25rem;
    }

    #fcst-current-data {
        grid-template-columns: 1fr;
    }

    .fcst-timeline-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .timeline-toggle {
        width: 100%;
        margin-top: 1rem;
    }
}

@media (max-width: 480px) {
    #fcst-current-title {
        font-size: 1.125rem;
    }

    .current-data-desc {
        font-size: 1rem;
    }
}
