/* ============================================================
   Nautic – System Zarządzania Dziennikiem Jachtowym
   Design: Maritime Instrument / Corporate Dark
   ============================================================ */

/* ---------- Design Tokens ---------- */
:root {
    --surface-dim:              #051424;
    --surface-container:        #122131;
    --surface-container-low:    #0d1a28;
    --surface-container-high:   #1c2b3c;
    --surface-container-highest:#273647;
    --primary:                  #c3f5ff;
    --primary-container:        #00e5ff;
    --on-primary:               #00363d;
    --secondary:                #bbc7dd;
    --on-surface:               #d4e4fa;
    --outline-variant:          #3b494c;
    --error:                    #ffb4ab;
    --error-container:          #93000a;
    --outline:                  #849396;
    --input-bg:                 #09101A;

    --font-hanken: 'Hanken Grotesk', sans-serif;
    --font-inter:  'Inter', sans-serif;
    --font-mono:   'JetBrains Mono', monospace;

    --sidebar-width: 260px;
}

/* ---------- Base ---------- */
body {
    background-color: var(--surface-dim);
    color: var(--on-surface);
    font-family: var(--font-inter);
    overflow-x: hidden;
    min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-hanken);
}

/* ---------- Layout ---------- */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    background-color: var(--surface-dim);
    border-right: 1px solid var(--outline-variant);
    padding: 2rem 0;
    z-index: 1000;
    overflow-y: auto;
}

/* Wrapper that sits to the right of the sidebar */
.main-wrapper {
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.main-content {
    flex: 1;
    padding: 2rem;
}

.messages-container {
    padding: 1rem 2rem 0;
}

/* ---------- Sidebar – Navigation ---------- */
.nav-link {
    color: var(--secondary);
    font-family: var(--font-mono);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: background-color 0.2s ease, color 0.2s ease;
    border-right: 4px solid transparent;
}

.nav-link:hover {
    background-color: var(--surface-container-highest);
    color: var(--on-surface);
}

.nav-link.active {
    color: var(--primary);
    background-color: var(--surface-container-high);
    border-right-color: var(--primary-container);
}

/* ---------- Sidebar – User Panel ---------- */
.sidebar-user-panel {
    background: var(--surface-container-low);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 0.25rem;
}

.sidebar-avatar {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    border: 1px solid rgba(0, 229, 255, 0.2);
    border-radius: 0.25rem;
}

/* ---------- Footer ---------- */
.site-footer {
    margin-left: 0;            /* already inside .main-wrapper */
    padding: 0.75rem 2rem;
    border-top: 1px solid var(--outline-variant);
    color: var(--secondary);
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.08em;
    text-align: center;
}

/* ---------- Typography Helpers ---------- */
.label-caps {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: var(--secondary);
    text-transform: uppercase;
}

.display-text {
    font-family: var(--font-hanken);
    font-weight: 700;
}

.data-text {
    font-family: var(--font-mono);
    font-weight: 500;
}

/* ---------- Buttons ---------- */
.btn-maritime-primary {
    background-color: var(--primary-container);
    color: var(--on-primary);
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    border-radius: 0.125rem;
    padding: 0.5rem 1.5rem;
    border: none;
    cursor: pointer;
    transition: filter 0.15s ease;
}

.btn-maritime-primary:hover {
    filter: brightness(1.12);
}

.btn-maritime-outline {
    background: transparent;
    border: 1px solid var(--primary-container);
    color: var(--primary-container);
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    border-radius: 0.125rem;
    padding: 0.5rem 1rem;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.btn-maritime-outline:hover {
    background-color: rgba(0, 229, 255, 0.08);
}

/* ---------- Cards ---------- */
.vessel-card {
    background-color: #111C2B;
    border: 1px solid #1E2F46;
    padding: 1.5rem;
    border-radius: 0.25rem;
    height: 100%;
    transition: border-color 0.2s ease;
}

.vessel-card:hover {
    border-color: #2D3E55;
}

/* ---------- Badges ---------- */
.badge-maritime {
    font-family: var(--font-mono);
    font-size: 10px;
    padding: 0.25rem 0.5rem;
    border: 1px solid var(--outline-variant);
    background: var(--surface-container-high);
    color: var(--primary);
    border-radius: 0.125rem;
    letter-spacing: 0.06em;
}

/* ---------- Tables ---------- */
.table-maritime {
    color: var(--on-surface);
    font-family: var(--font-mono);
    font-size: 14px;
}

.table-maritime thead th {
    font-size: 11px;
    color: var(--secondary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    background: var(--surface-container-high);
    border-bottom: 1px solid var(--outline-variant);
    padding-bottom: 1rem;
}

.table-maritime td {
    padding: 1rem 0;
    border-bottom: 1px solid rgba(59, 73, 76, 0.3);
    background: transparent !important;
    color: inherit;
}

/* ---------- Sub-navigation ---------- */
.sub-nav .nav-link {
    padding: 0 0 1rem 0;
    margin-right: 2rem;
    border-bottom: 2px solid transparent;
    border-right: none;
    text-transform: none;
    font-size: 12px;
}

.sub-nav .nav-link.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    border-right: none;
    background: transparent;
}

/* ---------- Material Symbols ---------- */
.material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

.fill-1 {
    font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

/* ---------- Floating Action Button ---------- */
.fab {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background-color: var(--primary-container);
    color: var(--on-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    transition: transform 0.2s ease;
    border: none;
    z-index: 1001;
    cursor: pointer;
}

.fab:hover {
    transform: scale(1.1);
}

/* ---------- Sidebar – Avatar link ---------- */
.sidebar-avatar-link {
    transition: border-color 0.2s ease, background-color 0.2s ease;
    cursor: pointer;
}

.sidebar-avatar-link:hover {
    background-color: rgba(0, 229, 255, 0.15) !important;
    border-color: rgba(0, 229, 255, 0.5);
}

/* ---------- Sidebar – Brand ---------- */
.sidebar-brand-logo-wrap {
    width: 40px;
    height: 40px;
}

.sidebar-brand-subtitle {
    font-size: 9px;
}

/* ---------- Sidebar – User panel ---------- */
.sidebar-user-name {
    font-size: 9px;
}

.sidebar-user-role {
    font-size: 8px;
}

/* ---------- Page headers ---------- */
/* Ikona w nagłówku strony (sailing, add_circle, manage_accounts itp.) */
.page-header-icon {
    font-size: 2rem;
    color: var(--primary);
}

/* Podtytuł pod nagłówkiem strony */
.page-header-subtitle {
    font-size: 10px;
    color: var(--secondary);
}

/* ---------- Card section headers ---------- */
/* Ikona w nagłówku sekcji karty (directions_boat, sailing, badge itp.) */
.section-icon {
    color: var(--primary);
}

/* ---------- Forms ---------- */
/* Etykieta pola formularza — drobniejsza od .label-caps (11 → 10 px) */
.form-field-label {
    font-size: 10px;
    color: var(--secondary);
}

/* Gwiazdka przy wymaganym polu */
.field-required-mark {
    color: var(--primary);
}

/* Adnotacja "(opcjonalnie)" przy niewymaganych polach */
.field-optional {
    color: var(--secondary);
    font-style: italic;
    text-transform: none;
    font-weight: 400;
}

/* ---------- Forms — Input overrides ---------- */
.form-control {
    background-color: var(--input-bg);
    border: 1px solid var(--outline-variant);
    border-radius: 0.25rem;
    color: var(--on-surface);
    font-family: var(--font-inter);
    font-size: 14px;
}

.form-control:focus {
    background-color: var(--input-bg);
    border-color: var(--primary-container);
    color: var(--on-surface);
    box-shadow: 0px 0px 8px rgba(0, 229, 255, 0.3);
    outline: none;
}

.form-control::placeholder {
    color: var(--outline);
    opacity: 1;
}

/* Ikona kalendarza w polach datetime-local */
.form-control[type="datetime-local"]::-webkit-calendar-picker-indicator {
    filter: invert(0.7) sepia(1) hue-rotate(160deg);
}

/* Select: własna strzałka w kolorze secondary */
select.form-control {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23bbc7dd' stroke-width='2' d='M2 5l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 16px 12px;
    padding-right: 2.5rem;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

/* Błędy walidacji (klasa pozostaje niezmieniona — test Selenium: test_auth.py:179) */
.invalid-feedback {
    color: var(--error);
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.04em;
}

/* Alert danger (klasa pozostaje niezmieniona — test Selenium: test_auth.py:179) */
.alert-danger {
    background-color: var(--error-container);
    border-color: var(--error);
    color: var(--error);
    font-family: var(--font-mono);
    font-size: 12px;
    border-radius: 0.25rem;
}

/* Help text pól formularza */
.form-help-text {
    color: var(--outline);
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.04em;
    margin-top: 0.25rem;
    margin-bottom: 0;
}

/* Globalne kolory linków */
a {
    color: var(--primary-container);
}

a:hover {
    color: var(--primary);
}

/* Separator hr — Bootstrap ustawia opacity: 0.25, przywracamy do pełnego */
hr {
    border-color: var(--outline-variant);
    opacity: 1;
}

/* ---------- Button helpers ---------- */
/* Mała ikona wewnątrz przycisku (.btn-maritime-primary / .btn-maritime-outline) */
.btn-icon {
    font-size: 1rem;
}

/* Kompaktowy wariant przycisków — np. "Szczegóły" w tabeli */
.btn-maritime-primary.btn-sm,
.btn-maritime-outline.btn-sm {
    font-size: 10px;
    padding: 0.25rem 0.75rem;
}

/* ---------- Empty states ---------- */
/* Duża ikona w centrum pustego widoku listy */
.empty-state-icon {
    font-size: 3rem;
    color: var(--secondary);
}
