/* ════════════════════════════════════════
   TOP NAVBAR
   ════════════════════════════════════════ */

.navbar {
    flex-shrink: 0;
    position: relative;
    z-index: 200;
    background: var(--ink);
    /* iOS PWA má black-translucent status bar → obsah jde pod něj. Bez
       safe-area paddingu se čas/baterie překrývaly s logem a ikonami. */
    height: calc(var(--navbar-h) + env(safe-area-inset-top, 0px));
    padding-top: env(safe-area-inset-top, 0px);
    border-bottom: 1px solid rgba(201, 168, 76, 0.15);
    animation: slideDown var(--duration-slow) var(--ease-out);
    overflow: visible;
}

.nav-container {
    position: relative;
    max-width: 860px;
    margin: 0 auto;
    padding: 0 20px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: #fff;
}

.nav-logo-icon {
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: var(--gold);
    line-height: 1;
}

.nav-logo-text {
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: #fff;
}

/* Desktop nav links */
.nav-links {
    display: none;
    gap: 2px;
    align-items: center;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 8px 14px;
    color: var(--ash);
    text-decoration: none;
    font-size: 0.8125rem;
    font-weight: 500;
    letter-spacing: 0.5px;
    border-radius: var(--radius-sm);
    transition: all var(--duration) var(--ease-out);
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 14px;
    right: 14px;
    height: 2px;
    background: var(--gold);
    border-radius: 1px;
    transform: scaleX(0);
    transition: transform var(--duration) var(--ease-out);
}

.nav-link:hover {
    color: #fff;
}

.nav-link.active {
    color: #fff;
}

.nav-link.active::after {
    transform: scaleX(1);
}

.nav-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 14px;
}

/* Avatar in navbar */
.nav-avatar {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-full);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--ink-mid);
    text-decoration: none;
    color: var(--gold);
    font-weight: 600;
    font-size: 0.8rem;
    border: 2px solid var(--charcoal);
    transition: border-color var(--duration) var(--ease-out);
}

.nav-avatar:hover {
    border-color: var(--gold);
}

.nav-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.notif-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.nav-mic {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--mist);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    transition: color var(--duration) var(--ease-out);
}

.nav-mic:hover {
    color: var(--gold);
}

/* Voice note modal */
.vn-overlay {
    position: fixed;
    inset: 0;
    z-index: 1001;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.vn-modal {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    max-width: 400px;
    width: 100%;
    padding: 28px 24px;
    text-align: center;
}

.vn-state {
    display: flex;
    flex-direction: column;
    align-items: center;
}

@keyframes vnPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(139, 26, 26, 0.4); }
    50% { box-shadow: 0 0 0 16px rgba(139, 26, 26, 0); }
}

.vn-mic-btn {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    border: 2px solid var(--border);
    background: var(--surface-raised);
    color: var(--mist);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.vn-mic-btn.recording {
    border-color: var(--crimson);
    color: var(--crimson);
    animation: vnPulse 1.5s ease-in-out infinite;
}

.vn-placeholder {
    color: var(--ash);
    font-size: 0.8125rem;
    margin-top: 16px;
    line-height: 1.5;
}

.vn-transcript {
    margin-top: 12px;
    min-height: 40px;
    max-height: 160px;
    overflow-y: auto;
    font-size: 0.9375rem;
    line-height: 1.5;
    text-align: left;
    width: 100%;
    padding: 8px;
    border-radius: var(--radius-sm);
    outline: none;
}

.vn-transcript:focus {
    background: var(--surface-raised);
}

.vn-actions {
    margin-top: 16px;
    display: flex;
    gap: 8px;
    justify-content: center;
}

.nav-bell {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--mist);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    transition: color var(--duration) var(--ease-out);
}

.nav-bell:hover {
    color: var(--gold);
}

.notif-badge {
    position: absolute;
    top: -4px;
    right: -6px;
    background: var(--crimson);
    color: #fff;
    font-size: 0.625rem;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    line-height: 16px;
    text-align: center;
    border-radius: var(--radius-full);
    padding: 0 4px;
    box-sizing: border-box;
}

/* Notification dropdown */
.notif-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 12px);
    right: -8px;
    width: 340px;
    max-height: 420px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
    z-index: 300;
    overflow: hidden;
}

.notif-dropdown.open {
    display: flex;
    flex-direction: column;
}

.notif-dropdown-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
}

.notif-dropdown-title {
    font-weight: 600;
    font-size: 0.875rem;
}

.notif-mark-all {
    background: none;
    border: none;
    color: var(--crimson);
    font-size: 0.75rem;
    cursor: pointer;
    font-weight: 500;
}

.notif-mark-all:hover {
    text-decoration: underline;
}

.notif-dropdown-list {
    overflow-y: auto;
    flex: 1;
}

.notif-item {
    display: block;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-light);
    text-decoration: none;
    color: var(--text);
    transition: background var(--duration) var(--ease-out);
}

.notif-item:hover {
    background: var(--rice);
}

.notif-item.unread {
    background: var(--crimson-glow);
    border-left: 3px solid var(--crimson);
    padding-left: 13px;
}

.notif-item.unread:hover {
    background: rgba(139, 26, 26, 0.08);
}

.notif-item-title {
    font-weight: 600;
    font-size: 0.8125rem;
    margin-bottom: 2px;
}

.notif-item-body {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.notif-item-time {
    font-size: 0.6875rem;
    color: var(--ash);
    margin-top: 4px;
}

/* Swipe to delete */
.notif-swipe-row {
    position: relative;
    overflow: hidden;
}

.notif-swipe-delete {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 80px;
    background: var(--crimson);
    color: #fff;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
}

.notif-swipe-read {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 80px;
    background: #2563eb;
    color: #fff;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
}

.notif-swipe-row.swiping .notif-swipe-delete {
    display: flex;
}

.notif-swipe-row.swiping-right .notif-swipe-read {
    display: flex;
}

.notif-swipe-row .notif-item {
    position: relative;
    z-index: 1;
    background: var(--surface);
    width: 100%;
    box-sizing: border-box;
}

.notif-swipe-row .notif-item.unread {
    background: var(--crimson-glow);
}

.notif-dropdown-empty {
    padding: 32px 16px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8125rem;
}

@media (max-width: 480px) {
    .notif-dropdown {
        position: fixed;
        top: var(--navbar-h);
        left: 0;
        right: 0;
        width: 100%;
        max-height: 60vh;
        border-radius: 0 0 var(--radius-md) var(--radius-md);
    }
}

.avatar-initials {
    text-transform: uppercase;
}

/* Hamburger */
.nav-hamburger {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    width: 40px;
    height: 40px;
    -webkit-tap-highlight-color: transparent;
}

.nav-hamburger span {
    width: 20px;
    height: 1.5px;
    background: var(--mist);
    border-radius: 1px;
    transition: all var(--duration) var(--ease-out);
    transform-origin: center;
}

.nav-hamburger.open span:nth-child(1) {
    transform: rotate(45deg) translate(4.5px, 4.5px);
}

.nav-hamburger.open span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.nav-hamburger.open span:nth-child(3) {
    transform: rotate(-45deg) translate(4.5px, -4.5px);
}

/* Mobile slide-out menu */
.nav-links.open {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    position: fixed;
    top: var(--navbar-h);
    right: 0;
    width: 220px;
    background: var(--ink);
    border-left: 1px solid rgba(201, 168, 76, 0.1);
    border-bottom: 1px solid rgba(201, 168, 76, 0.1);
    padding: 12px;
    border-radius: 0 0 0 var(--radius-md);
    box-shadow: var(--shadow-xl);
    animation: slideDown var(--duration) var(--ease-out);
    z-index: 300;
}

.nav-links.open .nav-link {
    padding: 12px 16px;
    font-size: 0.9rem;
    justify-content: flex-start;
    text-align: left;
    width: 100%;
}

/* ════════════════════════════════════════
   BOTTOM NAV (Mobile)
   ════════════════════════════════════════ */

.bottom-nav {
    flex-shrink: 0;
    z-index: 200;
    background: var(--surface);
    border-top: 1px solid var(--border);
    display: flex;
    align-items: stretch;
    height: var(--bottom-nav-h);
    padding-bottom: env(safe-area-inset-bottom, 0);
    padding-left: max(12px, env(safe-area-inset-left, 0));
    padding-right: max(12px, env(safe-area-inset-right, 0));
    box-shadow: 0 -4px 16px rgba(0,0,0,0.05);
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    text-decoration: none;
    color: var(--stone);
    font-size: 0.625rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    flex: 1 1 0;
    padding: 8px 4px;
    transition: color var(--duration-fast);
    -webkit-tap-highlight-color: transparent;
    position: relative;
}

.bottom-nav-item svg {
    width: 22px;
    height: 22px;
    stroke-width: 1.8;
}

.bottom-nav-item.active {
    color: var(--crimson);
}

.bottom-nav-item.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 28px;
    height: 2.5px;
    background: var(--crimson);
    border-radius: 0 0 2px 2px;
}

/* ════════════════════════════════════════
   MAIN CONTENT AREA
   ════════════════════════════════════════ */

.main-content {
    max-width: 860px;
    margin: 0 auto;
    padding: 20px 16px 28px;
    flex: 1 1 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    animation: fadeIn var(--duration-slow) var(--ease-out);
    width: 100%;
    box-sizing: border-box;
}
