/* 1. RESET & VARIABLES */
:root {
    --bg-page: #d4edff;       
    --bg-card: #ffffff;       
    --text-main: #0f172a;     
    --text-muted: #475569;    
    --accent: #0ea5e9;        
    --whatsapp: #22c55e;      
    --emergency: #ef4444;     
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-page);
    margin: 0;
    padding: 0;
    color: var(--text-main);
    -webkit-tap-highlight-color: transparent;
}

.app-container {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    background: var(--bg-page);
    overflow-x: hidden; 
}

/* 2. HERO HEADER */
.hero-header {
    position: relative;
    height: 280px; 
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 24px;
    background-color: #0f172a; 
    background-image: linear-gradient(transparent, rgba(0,0,0,0.1)),
        url('/images/ribarica_drone.jpg');
    background-size: cover;
    background-position: center;
    border-radius: 0;
    overflow: hidden;
    box-shadow: 0 10px 30px -10px rgba(0,0,0,0.3);
}

.hero-top {
    position: relative;
    z-index: 2;
    display: flex;
    justify-content: flex-start;
}

.weather-widget {
    display: flex;
    flex-direction: column;
    width: fit-content;
    gap: 2px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 8px 12px;
    border-radius: 16px;
    margin-bottom: 0;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.weather-main {
    display: flex;
    align-items: center;
    gap: 15px;
    width: 100%;
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1;
}

.weather-temp-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.weather-details {
    display: flex;
    gap: 8px;
    font-size: 0.75rem;
    opacity: 0.9;
    margin-top: 2px;
}

.weather-detail {
    display: flex;
    align-items: center;
    gap: 3px;
}

.weather-loc {
    font-size: 0.75rem;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 800;
}

.hero-footer {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    margin-top: 20px;
    width: 100%;
}

.hero-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(to top, rgba(15, 23, 42, 0.95) 0%, rgba(15, 23, 42, 0.4) 50%, rgba(15, 23, 42, 0.1) 100%);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    color: white;
}
.hero-content h1 {
    font-size: 34px;
    font-weight: 800;
    margin: 0;
    line-height: 1.1;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}
.hero-content p {
    margin-top: 6px;
    font-size: 16px;
    opacity: 0.9;
    font-weight: 500;
}

.hero-actions {
    display: flex;
    gap: 10px;
    margin-top: 0;
    flex-wrap: wrap;
}

.nav-btn {
    display: inline-flex;
    align-items: center;
    background: #ffffff;
    color: var(--text-main);
    padding: 10px 20px;
    border-radius: 20px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.nav-btn.secondary {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.4);
}

.nav-btn:active {
    transform: scale(0.95);
}

@media (hover: hover) {
    .nav-btn:hover {
        transform: translateY(-1px);
        box-shadow: 0 6px 18px rgba(0,0,0,0.22);
    }
}

.main-pad { padding: 24px; padding-bottom: 60px; }

/* 3. INFINITE CAROUSEL */
.tabs-wrapper {
    width: 100%;
    overflow: hidden;
    margin-bottom: 20px;
    mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent), 
                linear-gradient(to bottom, black 85%, transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent), 
                        linear-gradient(to bottom, black 85%, transparent);
    opacity: 0; 
    transition: opacity 0.5s ease;
}
.tabs-wrapper.loaded { opacity: 1; }

.tabs-container {
    display: flex;
    overflow-x: auto; 
    gap: 15px;
    padding: 10px 50% 10px 50%;
    scroll-snap-type: x proximity; 
    -webkit-overflow-scrolling: touch; 
    scrollbar-width: none; 
}
.tabs-container::-webkit-scrollbar { display: none; }

.tab-btn {
    scroll-snap-align: center;
    flex: 0 0 auto; 
    box-sizing: border-box;
    border: 2px solid transparent;
    background: #e2e8f0;
    width: 64px;
    height: 64px;
    border-radius: 20px;
    font-size: 34px; 
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.4;
    filter: grayscale(1);
    -webkit-tap-highlight-color: transparent; 
}

/* ACTIVE STATE */
.tab-btn.active {
    background: #ffffff !important;
    opacity: 1 !important;
    filter: grayscale(0) !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transform: scale(1.15);
    border-color: var(--accent);
    z-index: 10;
}

/* 4. ACCORDION CARDS */
details {
    background: var(--bg-card);
    border-radius: 16px;
    margin-bottom: 12px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.04); 
    border: 1px solid rgba(0,0,0,0.02);
}
summary {
    padding: 18px 20px;
    font-weight: 700;
    font-size: 16px;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    color: var(--text-main);
}
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; font-size: 24px; color: #cbd5e1; font-weight: 400; }
details[open] summary::after { content: "−"; color: var(--accent); }

.info-text {
    /* Height animation is applied to .info-text in JS; keep it padding-free to avoid jumpiness */
    padding: 0;
}
.info-text-inner {
    padding: 0 20px 24px 20px;
    line-height: 1.6;
    color: var(--text-muted);
    font-size: 15px;
}
.info-text-inner b { color: var(--text-main); font-weight: 700; }
.info-text-inner a { color: var(--accent); text-decoration: none; font-weight: 600; border-bottom: 1px dotted var(--accent); }
.emergency-link { color: var(--emergency) !important; border-bottom: 1px dotted var(--emergency) !important; }

/* 5. WHATSAPP BUTTON */
.whatsapp-btn {
    margin-top: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    background: var(--whatsapp);
    color: white;
    text-decoration: none;
    padding: 18px;
    border-radius: 16px;
    font-weight: 700;
    font-size: 16px;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.3);
    gap: 10px;
    overflow: visible;
    box-sizing: border-box;
    border: none;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.whatsapp-btn:active { transform: scale(0.98); }

@media (hover: hover) {
    .whatsapp-btn:hover {
        transform: translateY(-1px);
        box-shadow: 0 6px 18px rgba(37, 211, 102, 0.34);
    }
}
.icon {
    font-size: 18px;
    position: relative;
    display: inline-flex;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    justify-content: center;
    align-items: center;
    line-height: 1;
    padding: 0 2px;
    box-sizing: border-box;
    flex: none;
    overflow: visible;
    background: rgba(255, 255, 255, 0.16);
}

.content-area { display: none; }
.content-area.active { display: block; animation: fadeIn 0.4s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* Accordion open/close animation is handled in JS (smooth height transition). */

/* 9. FOOTER */
.footer {
    background-color: var(--bg-card);
    border-top: 1px solid #e2e8f0;
    padding: 20px 24px;
    text-align: center;
    color: var(--text-muted);
    font-size: 12px;
    margin-top: 32px;
}

.footer p {
    margin: 0;
}

/* 10. ACCESSIBILITY */
@media (prefers-reduced-motion: reduce) {
    .content-area.active {
        animation: none !important;
    }

    .nav-btn,
    .whatsapp-btn {
        transition: none !important;
    }
}
