/* Estreka — header (navy-steel kest)
   Vt: Rakenduse kaasaegne kujundus/design_handoff_estreka/README.md
   Navy gradient, sticky; valge logo-plaat; kelluke + kasutajakiip;
   dropdown: valge, kandiline, ilma gradientide/animatsioonideta. */

.header {
    background: var(--header-gradient, linear-gradient(135deg, #1a5580 0%, #103a57 100%));
    border-bottom: 1px solid rgba(255, 255, 255, .1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 32px;
}

.navbar-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 12px 0;
}

/* --- Bränd: valge plaat + ESTREKA + RATSAKLUBI --- */
.navbar-brand { flex-shrink: 0; }

.brand-link {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.brand-plate {
    background: #fff;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.brand-logo {
    height: 32px;
    width: auto;
    display: block;
}

.brand-text {
    font-size: 20px;
    font-weight: 800;
    color: #fff;
    letter-spacing: .04em;
}

.brand-sub {
    font-size: 11px;
    font-weight: 600;
    color: rgba(255, 255, 255, .6);
    letter-spacing: .14em;
    text-transform: uppercase;
    border-left: 1px solid rgba(255, 255, 255, .25);
    padding-left: 12px;
    margin-left: 2px;
}

/* --- Avalik keskmenüü --- */
.public-nav {
    display: flex;
    align-items: center;
    gap: 28px;
}

.public-nav a {
    font-size: 14px;
    font-weight: 500;
    color: rgba(255, 255, 255, .75);
    text-decoration: none;
}

.public-nav a:hover { color: #fff; }

/* --- Parem pool --- */
.navbar-user {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

/* Kelluke punase loendusmärgiga */
.bell-btn {
    position: relative;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, .1);
    border: 1px solid rgba(255, 255, 255, .2);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.bell-btn:hover { background: rgba(255, 255, 255, .18); }

.bell-btn .ds-icon { width: 18px; height: 18px; }

.bell-badge {
    position: absolute;
    /* nupu servast VÄLJAPOOLE — top/right -1px hoidis badge'i nupu sees ja see
       kattis kellukese ülemise nurga (2026-07-28) */
    top: -6px;
    right: -6px;
    min-width: 16px;
    height: 16px;
    background: var(--danger-color, #ef4444);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
}

/* --- Kasutajakiip --- */
.user-menu { position: relative; }

.user-menu-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px 6px 6px;
    background: rgba(255, 255, 255, .1);
    border: 1px solid rgba(255, 255, 255, .2);
    cursor: pointer;
    font-family: inherit;
}

.user-menu-toggle:hover { background: rgba(255, 255, 255, .18); }

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 9999px;
    overflow: hidden;
    background: rgba(255, 255, 255, .15);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    flex-shrink: 0;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.user-avatar .ds-icon { width: 16px; height: 16px; }

.user-avatar.large { width: 44px; height: 44px; }

.user-info {
    text-align: left;
    line-height: 1.2;
}

.user-info .user-name {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
}

.user-info .user-role {
    display: block;
    font-size: 11px;
    color: rgba(255, 255, 255, .7);
}

.dropdown-arrow {
    width: 16px;
    height: 16px;
    color: rgba(255, 255, 255, .8);
    transition: transform 150ms ease;
}

/* --- Dropdown: valge, kandiline, ilma efektideta --- */
.user-menu-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 280px;
    max-height: calc(100vh - 90px);
    overflow-y: auto;
    background: #fff;
    border: 1px solid var(--gray-200, #e2e8f0);
    box-shadow: 0 8px 24px rgba(15, 23, 42, .12);
    z-index: 200;
}

.user-menu-dropdown.show { display: block; }

.dropdown-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--accent-bg, #eef4f8);
    border-bottom: 1px solid var(--accent-border, #cfe0ea);
}

.dropdown-header .user-avatar {
    background: var(--primary-color, #1a5580);
}

.dropdown-header .user-details .user-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--gray-900, #0f172a);
}

.dropdown-header .user-details .user-role {
    font-size: 12px;
    color: var(--gray-500, #64748b);
}

.dropdown-divider {
    height: 1px;
    background: var(--gray-200, #e2e8f0);
    margin: 6px 0;
}

.dropdown-section-title {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--gray-500, #64748b);
    padding: 8px 16px 4px;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 16px;
    font-size: 14px;
    color: var(--gray-700, #334155);
    text-decoration: none;
}

.dropdown-item .ds-icon {
    width: 16px;
    height: 16px;
    color: var(--gray-500, #64748b);
    flex-shrink: 0;
}

.dropdown-item:hover {
    background: var(--accent-bg, #eef4f8);
    color: var(--primary-color, #1a5580);
}

.dropdown-item:hover .ds-icon { color: var(--primary-color, #1a5580); }

.dropdown-item .notification-badge { margin-left: auto; }

.logout-item { color: var(--danger-color, #ef4444); }
.logout-item .ds-icon { color: var(--danger-color, #ef4444); }
.logout-item:hover {
    background: #fef2f2;
    color: var(--danger-color, #ef4444);
}
.logout-item:hover .ds-icon { color: var(--danger-color, #ef4444); }

.notification-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: var(--danger-color, #ef4444);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
}

/* --- Avalikud auth-nupud --- */
.auth-buttons {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-auth {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 18px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
}

.btn-auth .ds-icon { width: 16px; height: 16px; }

.btn-auth-outline {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, .3);
    color: #fff;
}

.btn-auth-outline:hover { border-color: rgba(255, 255, 255, .6); color: #fff; }

.btn-auth-solid {
    background: #fff;
    color: var(--primary-dark, #103a57);
    border: 1px solid #fff;
}

.btn-auth-solid:hover { background: var(--accent-bg, #eef4f8); }

/* --- Flash-teated --- */
.notifications-container {
    position: fixed;
    top: 76px;
    right: 24px;
    z-index: 300;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 420px;
}

.alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    background: #fff;
    border: 1px solid var(--gray-200, #e2e8f0);
    border-left: 3px solid var(--primary-color, #1a5580);
    font-size: 14px;
    box-shadow: 0 4px 16px rgba(15, 23, 42, .1);
}

.alert-success { border-left-color: var(--success-color, #10b981); }
.alert-warning { border-left-color: var(--warning-color, #f59e0b); }
.alert-error { border-left-color: var(--danger-color, #ef4444); }
.alert-info { border-left-color: var(--info-color, #06b6d4); }

.alert-content { flex: 1; }

.alert-meta {
    font-size: 12px;
    color: var(--gray-500, #64748b);
    margin-top: 4px;
}

.alert-close {
    background: none;
    border: none;
    font-size: 18px;
    line-height: 1;
    color: var(--gray-500, #64748b);
    cursor: pointer;
    padding: 0 2px;
}

/* --- Sisu wrapper --- */
.page-wrapper {
    min-height: calc(100vh - 200px);
}

/* --- Responsive --- */
@media (max-width: 900px) {
    .navbar .container { padding: 0 16px; }
    .public-nav { display: none; }
    .brand-sub { display: none; }
}

@media (max-width: 600px) {
    .user-info { display: none; }
    .brand-text { font-size: 17px; }
    .btn-auth { padding: 10px 12px; }
    .user-menu-dropdown { width: 260px; right: -8px; }
    .notifications-container {
        left: 12px;
        right: 12px;
        max-width: none;
    }
}

@media print {
    .header, .notifications-container { display: none; }
    .page-wrapper { min-height: auto; }
}
