/* Style strony głównej (lista/wyszukiwarka marin) - public/index.html */

:root {
    --navy-900: #0b3d5c;
    --navy-700: #12557e;
    --teal-500: #14b8a6;
    --teal-600: #0d9488;
    --bg: #f3f6f9;
    --surface: #ffffff;
    --text: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.08);
    --shadow-md: 0 8px 20px rgba(15, 23, 42, 0.1);
    --shadow-lg: 0 20px 45px rgba(11, 61, 92, 0.16);
    --gradient-brand: linear-gradient(135deg, var(--navy-900), var(--teal-600));
    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* TRYB CIEMNY - patrz analogiczny blok w style.css po wyjaśnienie zasady (media query + atrybut nadpisują się nawzajem) */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --navy-900: #7dd3fc;
        --navy-700: #38bdf8;
        --bg: #0a1220;
        --surface: #131c2e;
        --text: #e2e8f0;
        --text-muted: #94a3b8;
        --border: #253247;
    }
}

:root[data-theme="dark"] {
    --navy-900: #7dd3fc;
    --navy-700: #38bdf8;
    --bg: #0a1220;
    --surface: #131c2e;
    --text: #e2e8f0;
    --text-muted: #94a3b8;
    --border: #253247;
}

/* ========================================= */
/* --- TWARDY RESET (Naprawia rozpadanie się na mobile) --- */
/* ========================================= */
*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    overflow-x: hidden; /* Bezwzględna blokada poziomego rozjeżdżania się strony */
    background-color: var(--bg);
    color: var(--text);
    font-family: var(--font-sans);
}

/* ========================================= */
/* --- GŁÓWNY, CENTRALNY UKŁAD STRONY --- */
/* ========================================= */
.portal-header {
    width: 100%;
    background: var(--gradient-brand);
    padding: 56px 20px 70px 20px;
    display: flex;
    flex-direction: column;
    align-items: center; /* Zawsze na środku! */
    gap: 22px;
    margin-bottom: -40px; /* karty "wchodzą" na dolny gradient nagłówka */
    position: relative;
    overflow: hidden;
}

/* Przełącznik motywu - okrągły przycisk z ikoną SVG (słońce/księżyc), umieszczony w rogu nagłówka
   (patrz analogiczny ".lang-switcher" w style.css - te same wartości pozycjonowania). */
.theme-toggle-corner {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 2;
}

.theme-toggle-btn {
    width: 36px;
    height: 36px;
    padding: 0;
    margin: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: white;
    color: var(--navy-900);
    border: none;
    border-radius: 50%;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.theme-toggle-btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.theme-toggle-btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.theme-toggle-btn .icon-sun { display: none; }
.theme-toggle-btn.is-dark .icon-moon { display: none; }
.theme-toggle-btn.is-dark .icon-sun { display: block; }

/* Link do panelu obsługi - świadomie mały i mało rzucający się w oczy w rogu, bo klienta to nie dotyczy */
.staff-login-link {
    position: absolute;
    top: 15px;
    left: 15px;
    z-index: 2;
    color: rgba(255, 255, 255, 0.75);
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.staff-login-link:hover { background: rgba(255, 255, 255, 0.12); color: white; border-color: rgba(255, 255, 255, 0.5); }

/* delikatna, dekoracyjna "fala" oddzielająca nagłówek od reszty strony */
.portal-header::after {
    content: "";
    position: absolute;
    left: 0; right: 0; bottom: -1px;
    height: 60px;
    background: var(--bg);
    border-radius: 50% 50% 0 0 / 100% 100% 0 0;
    transform: scaleX(1.4);
}

.brand-lockup {
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
    z-index: 1;
}

.brand-lockup .brand-icon {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    border: 1.5px solid rgba(255, 255, 255, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

.brand-lockup .brand-icon svg { width: 24px; height: 24px; }

.navbar-brand {
    font-size: 34px;
    font-weight: 800;
    color: white;
    text-decoration: none;
    letter-spacing: -0.01em;
}

.portal-tagline {
    margin: -14px 0 0;
    color: rgba(255, 255, 255, 0.85);
    font-size: 15px;
    text-align: center;
    position: relative;
    z-index: 1;
}

.search-container {
    width: 100%;
    max-width: 600px; /* Maksymalna szerokość na komputerze */
    position: relative;
    z-index: 1;
}

.search-container .search-icon {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
    display: flex;
}

.search-container input {
    width: 100%;
    padding: 15px 25px 15px 48px;
    border: none;
    border-radius: 30px;
    font-size: 16px;
    outline: none;
    transition: box-shadow 0.2s;
    box-shadow: var(--shadow-lg);
    font-family: inherit;
}

.search-container input:focus {
    box-shadow: var(--shadow-lg), 0 0 0 3px rgba(255, 255, 255, 0.5);
}

.navbar-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
    width: 100%;
    position: relative;
    z-index: 1;
}

.lang-group {
    display: flex;
    gap: 5px;
    justify-content: center;
}

.lang-btn {
    background: rgba(255, 255, 255, 0.12);
    border: 1.5px solid rgba(255, 255, 255, 0.35);
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    color: white;
    padding: 7px 14px;
    border-radius: 20px;
    transition: 0.2s;
}

.lang-btn:hover { background-color: rgba(255, 255, 255, 0.25); }
.lang-btn.active {
    color: var(--navy-900);
    border-color: white;
    background-color: white;
}

/* ========================================= */
/* --- KARTY PORTÓW --- */
/* ========================================= */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    padding: 0 20px 50px 20px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    position: relative;
    z-index: 1;
}

.marina-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    width: 100%;
}

.marina-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
}

.marina-card img {
    width: 100%;
    height: 220px;
    object-fit: cover;
}

.marina-card-content {
    padding: 25px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    justify-content: space-between;
}

.marina-card h3 {
    margin: 0 0 10px 0;
    color: var(--navy-900);
    font-size: 21px;
    font-weight: 700;
}

.marina-address {
    margin: 0 0 20px 0;
    color: var(--text-muted);
    font-size: 15px;
    line-height: 1.4;
}

.book-btn {
    display: block;
    text-align: center;
    background: var(--gradient-brand);
    color: white;
    text-decoration: none;
    padding: 14px;
    border-radius: var(--radius-md);
    font-size: 16px;
    font-weight: 700;
    transition: transform 0.15s, box-shadow 0.15s;
    width: 100%;
    box-shadow: var(--shadow-sm);
}

.book-btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }

.no-results {
    grid-column: 1 / -1;
    text-align: center;
    font-size: 17px;
    color: var(--text-muted);
    padding: 50px 20px;
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.no-results-error { color: #dc2626; }

/* ========================================= */
/* --- TELEFONY (MEDIA QUERIES) --- */
/* ========================================= */
@media (max-width: 768px) {
    .portal-header {
        padding: 40px 15px 60px 15px;
    }
    .navbar-brand {
        font-size: 28px;
    }
    .navbar-controls {
        flex-direction: column; /* Na telefonie przyciski kładziemy pionowo */
        gap: 15px;
    }
    .cards-grid {
        grid-template-columns: 1fr; /* Na telefonie wyniki ściśle jedna pod drugą */
        gap: 20px;
        padding: 0 15px 40px 15px;
    }
    .marina-card-content {
        padding: 20px;
    }
}
