/****************************************************
 * SURF WIDGET – RADIO PURA STYLE
 * Colorful, playful, beachy vibes
 ****************************************************/

/* ================================
   WIDGET CONTAINER
   ================================ */

.surf-widget {
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    background: linear-gradient(135deg, rgba(20, 30, 48, 0.9), rgba(30, 25, 45, 0.88));
    border: 2px solid rgba(0, 217, 217, 0.3);
    border-radius: 24px;
    font-family: "Inter", "Nunito", "Comfortaa", system-ui, -apple-system, sans-serif;
    display: none;
    flex-direction: column;
    position: fixed;
    bottom: 9rem;
    left: 1.5rem;
    width: 330px;
    max-width: calc(100vw - 3rem);
    max-height: calc(60vh);
    z-index: 97;
    color: #FFF9F0;
    box-shadow: 
        0 20px 60px rgba(255, 107, 53, 0.15),
        0 10px 30px rgba(0, 217, 217, 0.2),
        0 0 0 1px rgba(255, 255, 255, 0.1);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
}

.surf-widget.is-visible {
    display: flex !important;
    animation: slideUpBounce 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes slideUpBounce {
    0% {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Mobile animation - preserve horizontal centering */
@media (max-width: 768px) {
    @keyframes slideUpBounce {
        0% {
            opacity: 0;
            transform: translateX(-50%) translateY(20px) scale(0.95);
        }
        100% {
            opacity: 1;
            transform: translateX(-50%) translateY(0) scale(1);
        }
    }
    
    /* On mobile, surf widget should cover Tap to Listen (more important data) */
    .surf-widget {
        z-index: 100;
    }
}

/* Day theme - Warm beachy vibes */
body[data-theme="day"] .surf-widget {
    background: linear-gradient(135deg, rgba(255, 249, 240, 0.95), rgba(255, 245, 235, 0.92));
    color: #2D3748;
    border-color: rgba(255, 107, 53, 0.3);
    box-shadow: 
        0 20px 60px rgba(255, 107, 53, 0.12),
        0 10px 30px rgba(0, 217, 217, 0.15),
        0 0 0 1px rgba(255, 107, 53, 0.2);
}

/* ================================
   HEADER SECTION
   ================================ */

.surf-widget__header {
    padding: 1.5rem 1.5rem 1.25rem;
    background: linear-gradient(180deg, rgba(0, 217, 217, 0.05) 0%, transparent 100%);
    border-bottom: 2px solid rgba(0, 217, 217, 0.15);
}

body[data-theme="day"] .surf-widget__header {
    background: linear-gradient(180deg, rgba(255, 215, 0, 0.08) 0%, transparent 100%);
    border-bottom-color: rgba(255, 107, 53, 0.15);
}

.surf-widget__title-group {
    margin-bottom: 1rem;
}

.surf-widget__title {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    background: linear-gradient(90deg, #00D9D9, #00FF88);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
    font-weight: 800;
}

body[data-theme="day"] .surf-widget__title {
    background: linear-gradient(90deg, #FF6B35, #FFD700);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.surf-widget__spot {
    font-size: 1.6rem;
    font-weight: 900;
    line-height: 1.2;
    margin-bottom: 0.35rem;
    background: linear-gradient(135deg, #00D9D9, #00FF88, #FFD700);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
}

body[data-theme="day"] .surf-widget__spot {
    background: linear-gradient(135deg, #FF6B35, #FF006E, #8B5CF6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.surf-widget__meta {
    font-size: 0.85rem;
    color: rgba(255, 249, 240, 0.7);
    line-height: 1.4;
    font-weight: 500;
}

body[data-theme="day"] .surf-widget__meta {
    color: rgba(45, 55, 72, 0.7);
}

/* Spot selection pills - Rainbow gradient fun! */
.surf-widget__spots {
    display: flex;
    gap: 0.45rem;
    flex-wrap: wrap;
    margin-top: 1rem;
    max-width: 100%;
}

.surf-widget__spot-button {
    font-family: inherit;
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 700;
    padding: 0.45rem 0.7rem;
    background: linear-gradient(135deg, rgba(0, 217, 217, 0.15), rgba(0, 255, 136, 0.1));
    border: 2px solid rgba(0, 217, 217, 0.3);
    border-radius: 20px;
    color: #00D9D9;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    flex: 0 1 auto;
    white-space: nowrap;
}

.surf-widget__spot-button:hover {
    background: linear-gradient(135deg, rgba(0, 217, 217, 0.25), rgba(0, 255, 136, 0.2));
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 217, 217, 0.3);
}

.surf-widget__spot-button.is-active {
    background: linear-gradient(135deg, #00D9D9, #00FF88);
    border-color: #00D9D9;
    color: #1A1A2E;
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 217, 217, 0.4);
}

body[data-theme="day"] .surf-widget__spot-button {
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.12), rgba(255, 215, 0, 0.08));
    border-color: rgba(255, 107, 53, 0.3);
    color: #FF6B35;
}

body[data-theme="day"] .surf-widget__spot-button:hover {
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.2), rgba(255, 215, 0, 0.15));
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.25);
}

body[data-theme="day"] .surf-widget__spot-button.is-active {
    background: linear-gradient(135deg, #FF6B35, #FFD700);
    border-color: #FF6B35;
    color: #FFF;
    box-shadow: 0 6px 20px rgba(255, 107, 53, 0.35);
}

/* ================================
   BODY - SCROLLABLE CONTAINER
   ================================ */

.surf-widget__body {
    padding: 1.25rem 1.5rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    overflow-y: auto;
    max-height: calc(60vh - 180px);
}

/* Custom scrollbar - Colorful! */
.surf-widget__body::-webkit-scrollbar {
    width: 6px;
}

.surf-widget__body::-webkit-scrollbar-track {
    background: rgba(0, 217, 217, 0.08);
    border-radius: 10px;
}

.surf-widget__body::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #00D9D9, #00FF88);
    border-radius: 10px;
}

body[data-theme="day"] .surf-widget__body::-webkit-scrollbar-track {
    background: rgba(255, 107, 53, 0.08);
}

body[data-theme="day"] .surf-widget__body::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #FF6B35, #FFD700);
}

/* ================================
   RATING BADGE - Rainbow fun!
   ================================ */

.surf-widget__rating {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    align-self: flex-start;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.surf-widget__rating--clean {
    background: linear-gradient(135deg, #00FF88, #00D9D9);
    color: #1A1A2E;
    border: 2px solid #00FF88;
}

.surf-widget__rating--clean::before {
    content: "✓";
    font-size: 1rem;
}

.surf-widget__rating--fair {
    background: linear-gradient(135deg, #FFD700, #FF6B35);
    color: #1A1A2E;
    border: 2px solid #FFD700;
}

.surf-widget__rating--fair::before {
    content: "~";
    font-size: 1rem;
}

.surf-widget__rating--poor {
    background: linear-gradient(135deg, #FF006E, #8B5CF6);
    color: #FFF;
    border: 2px solid #FF006E;
}

.surf-widget__rating--poor::before {
    content: "✕";
    font-size: 1rem;
}

/* ================================
   CURRENT CONDITIONS GRID
   ================================ */

.surf-widget__current {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.surf-widget__metric {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    background: rgba(0, 217, 217, 0.05);
    padding: 1rem;
    border-radius: 18px;
    border: 1px solid rgba(0, 217, 217, 0.15);
    transition: all 0.3s ease;
}

.surf-widget__metric:hover {
    background: rgba(0, 217, 217, 0.08);
    transform: translateY(-2px);
}

body[data-theme="day"] .surf-widget__metric {
    background: rgba(255, 107, 53, 0.05);
    border-color: rgba(255, 107, 53, 0.15);
}

body[data-theme="day"] .surf-widget__metric:hover {
    background: rgba(255, 107, 53, 0.08);
}

.surf-widget__metric label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    background: linear-gradient(90deg, #00D9D9, #00FF88);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 800;
}

body[data-theme="day"] .surf-widget__metric label {
    background: linear-gradient(90deg, #FF6B35, #FFD700);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.surf-widget__value {
    font-size: 1.6rem;
    font-weight: 900;
    line-height: 1;
    color: #FFF9F0;
}

body[data-theme="day"] .surf-widget__value {
    color: #2D3748;
}

/* Wind specific styling */
.surf-widget__wind-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.surf-widget__wind-details {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-top: 0.35rem;
}

.surf-widget__wind-direction {
    font-size: 0.75rem;
    color: rgba(255, 249, 240, 0.7);
    font-weight: 600;
}

body[data-theme="day"] .surf-widget__wind-direction {
    color: rgba(45, 55, 72, 0.7);
}

.surf-widget__wind-state {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.25rem 0.6rem;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: inline-block;
}

.surf-widget__wind-state--offshore {
    background: linear-gradient(135deg, #00FF88, #00D9D9);
    color: #1A1A2E;
}

.surf-widget__wind-state--onshore {
    background: linear-gradient(135deg, #FF006E, #FF6B35);
    color: #FFF;
}

.surf-widget__wind-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(0, 217, 217, 0.2), rgba(0, 255, 136, 0.15));
    border: 2px solid rgba(0, 217, 217, 0.3);
    font-size: 1rem;
    transition: transform 0.3s ease;
}

body[data-theme="day"] .surf-widget__wind-arrow {
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.15), rgba(255, 215, 0, 0.1));
    border-color: rgba(255, 107, 53, 0.3);
}

/* Swell direction */
.surf-widget__swell-direction {
    font-size: 0.75rem;
    color: rgba(255, 249, 240, 0.7);
    margin-top: 0.35rem;
    font-weight: 600;
}

body[data-theme="day"] .surf-widget__swell-direction {
    color: rgba(45, 55, 72, 0.7);
}

/* ================================
   HORIZONTAL SCROLL SECTIONS
   ================================ */

.surf-widget__section {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.surf-widget__section-title {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    background: linear-gradient(90deg, #00D9D9, #00FF88, #FFD700);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

body[data-theme="day"] .surf-widget__section-title {
    background: linear-gradient(90deg, #FF6B35, #FF006E, #8B5CF6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Forecast horizontal scroll */
.surf-widget__mini-forecast {
    display: flex;
    gap: 0.75rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    scrollbar-width: thin;
}

.surf-widget__mini-forecast::-webkit-scrollbar {
    height: 5px;
}

.surf-widget__mini-forecast::-webkit-scrollbar-track {
    background: rgba(0, 217, 217, 0.08);
    border-radius: 10px;
}

.surf-widget__mini-forecast::-webkit-scrollbar-thumb {
    background: linear-gradient(90deg, #00D9D9, #00FF88);
    border-radius: 10px;
}

body[data-theme="day"] .surf-widget__mini-forecast::-webkit-scrollbar-track {
    background: rgba(255, 107, 53, 0.08);
}

body[data-theme="day"] .surf-widget__mini-forecast::-webkit-scrollbar-thumb {
    background: linear-gradient(90deg, #FF6B35, #FFD700);
}

.surf-widget__mini-item {
    min-width: 75px;
    flex-shrink: 0;
    padding: 0.85rem 0.7rem;
    border-radius: 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    background: rgba(0, 217, 217, 0.08);
    border: 2px solid rgba(0, 217, 217, 0.15);
}

.surf-widget__mini-item:hover {
    background: rgba(0, 217, 217, 0.12);
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 217, 217, 0.25);
}

.surf-widget__mini-item.is-active {
    background: linear-gradient(135deg, rgba(0, 217, 217, 0.25), rgba(0, 255, 136, 0.2));
    border-color: #00D9D9;
    transform: scale(1.08);
    box-shadow: 0 8px 25px rgba(0, 217, 217, 0.35);
}

body[data-theme="day"] .surf-widget__mini-item {
    background: rgba(255, 107, 53, 0.08);
    border-color: rgba(255, 107, 53, 0.15);
}

body[data-theme="day"] .surf-widget__mini-item:hover {
    background: rgba(255, 107, 53, 0.12);
    box-shadow: 0 6px 20px rgba(255, 107, 53, 0.2);
}

body[data-theme="day"] .surf-widget__mini-item.is-active {
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.2), rgba(255, 215, 0, 0.15));
    border-color: #FF6B35;
    box-shadow: 0 8px 25px rgba(255, 107, 53, 0.3);
}

.surf-widget__mini-time {
    font-size: 0.65rem;
    color: rgba(255, 249, 240, 0.6);
    margin-bottom: 0.5rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

body[data-theme="day"] .surf-widget__mini-time {
    color: rgba(45, 55, 72, 0.6);
}

.surf-widget__mini-height {
    font-size: 1.1rem;
    font-weight: 900;
    background: linear-gradient(135deg, #00D9D9, #00FF88);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

body[data-theme="day"] .surf-widget__mini-height {
    background: linear-gradient(135deg, #FF6B35, #FFD700);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ================================
   TIDE SECTION - Colorful waves!
   ================================ */

.tide-scroll {
    display: flex;
    gap: 0.75rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    scrollbar-width: thin;
}

.tide-scroll::-webkit-scrollbar {
    height: 5px;
}

.tide-scroll::-webkit-scrollbar-track {
    background: rgba(0, 217, 217, 0.08);
    border-radius: 10px;
}

.tide-scroll::-webkit-scrollbar-thumb {
    background: linear-gradient(90deg, #00D9D9, #00FF88);
    border-radius: 10px;
}

body[data-theme="day"] .tide-scroll::-webkit-scrollbar-track {
    background: rgba(255, 107, 53, 0.08);
}

body[data-theme="day"] .tide-scroll::-webkit-scrollbar-thumb {
    background: linear-gradient(90deg, #FF6B35, #FFD700);
}

.tide-card {
    min-width: 115px;
    flex-shrink: 0;
    padding: 0.85rem 1rem;
    border-radius: 18px;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
}

.tide-card:hover {
    transform: translateY(-4px) scale(1.05);
}

.tide-card--high {
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.25), rgba(255, 215, 0, 0.2));
    border: 2px solid rgba(255, 107, 53, 0.4);
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.25);
}

.tide-card--high .tide-type {
    background: linear-gradient(90deg, #FF6B35, #FFD700);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 900;
}

.tide-card--high::before {
    content: "↑";
    position: absolute;
    top: 0.65rem;
    right: 0.65rem;
    font-size: 1.2rem;
    background: linear-gradient(180deg, #FF6B35, #FFD700);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tide-card--low {
    background: linear-gradient(135deg, rgba(0, 217, 217, 0.25), rgba(59, 130, 246, 0.2));
    border: 2px solid rgba(0, 217, 217, 0.4);
    box-shadow: 0 4px 15px rgba(0, 217, 217, 0.25);
}

.tide-card--low .tide-type {
    background: linear-gradient(90deg, #00D9D9, #3B82F6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 900;
}

.tide-card--low::before {
    content: "↓";
    position: absolute;
    top: 0.65rem;
    right: 0.65rem;
    font-size: 1.2rem;
    background: linear-gradient(180deg, #00D9D9, #3B82F6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

body[data-theme="day"] .tide-card--high {
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.18), rgba(255, 215, 0, 0.12));
}

body[data-theme="day"] .tide-card--low {
    background: linear-gradient(135deg, rgba(0, 217, 217, 0.18), rgba(59, 130, 246, 0.12));
}

.tide-type {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.5rem;
}

.tide-time {
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    color: #FFF9F0;
}

body[data-theme="day"] .tide-time {
    color: #2D3748;
}

.tide-height {
    font-size: 0.75rem;
    color: rgba(255, 249, 240, 0.7);
    font-weight: 600;
}

body[data-theme="day"] .tide-height {
    color: rgba(45, 55, 72, 0.7);
}

/* ================================
   LOADING STATE
   ================================ */

.surf-widget__status {
    padding: 3rem 1.5rem;
    text-align: center;
    font-size: 0.9rem;
    color: rgba(255, 249, 240, 0.6);
}

body[data-theme="day"] .surf-widget__status {
    color: rgba(45, 55, 72, 0.6);
}

/* ================================
   MOBILE RESPONSIVE
   ================================ */

@media (max-width: 768px) {
    .surf-widget {
        position: fixed;
        top: 12rem;              /* Start below logo */
        bottom: 5rem;            /* Extend to bottom (same as Tap to Listen/NOW PLAYING) */
        left: 50%;
        transform: translateX(-50%);
        width: calc(100% - 2rem);
        max-width: 400px;
        max-height: none;        /* Let it fill the available space */
        height: auto;
    }
    
    .surf-widget__header {
        padding: 1.25rem 1.25rem 1rem;
    }
    
    .surf-widget__body {
        padding: 1rem 1.25rem 1.25rem;
        gap: 1rem;
        max-height: calc(100vh - 26rem);  /* Full height minus header and margins */
        overflow-y: auto;
    }
    
    .surf-widget__spot {
        font-size: 1.4rem;
    }
    
    .surf-widget__current {
        gap: 0.85rem;
    }
    
    .surf-widget__value {
        font-size: 1.4rem;
    }
    
    .surf-widget__mini-item,
    .tide-card {
        min-width: 70px;
    }
    
    /* Ensure spot buttons fit nicely in two lines on mobile */
    .surf-widget__spot-button {
        font-size: 0.6rem;
        padding: 0.4rem 0.65rem;
        letter-spacing: 0.03em;
    }
}