/* ==========================================
   RESPONSIVE — SMALL PHONE
   ========================================== */
@media (max-width: 480px) {
    .header-icon-group {
        gap: 0.35rem;
        margin-top: 1.5rem;
    }

    .header-icon-btn {
        padding: 0.3rem 0.55rem;
        font-size: 0.85rem;
    }

    .header-icon-label {
        font-size: 0.52rem;
    }

    .info-features-grid {
        grid-template-columns: 1fr;
    }

    .pomo-ring-wrap {
        width: 170px;
        height: 170px;
    }

    .pomo-ring {
        width: 170px;
        height: 170px;
    }

    #pomoTime {
        font-size: 2.5rem;
    }
}


/* ============================================================
   MOBILE-FIRST REDESIGN — TOP BAR + SIDEBAR + BOTTOM NAV
   ============================================================ */

/* ---- TOP BAR ---- */
.top-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 200;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 0.75rem;
    background: rgba(15, 12, 41, 0.85);
    -webkit-
    border-bottom: 1px solid rgba(255,255,255,0.07);
}

.top-bar-btn {
    background: none;
    border: none;
    color: var(--text-primary, #e2e8f0);
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    transition: background 0.2s;
    min-width: 44px;
    min-height: 44px;
}
.top-bar-btn:hover { background: rgba(255,255,255,0.08); }

.hamburger-btn {
    flex-direction: column;
    gap: 5px;
}
.hamburger-line {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text-primary, #e2e8f0);
    border-radius: 2px;
    transition: all 0.3s ease;
}
.sidebar-open .hamburger-btn .hamburger-line:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.sidebar-open .hamburger-btn .hamburger-line:nth-child(2) { opacity: 0; }
.sidebar-open .hamburger-btn .hamburger-line:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.top-bar-title {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary, #e2e8f0);
    letter-spacing: 0.02em;
}
.app-logo {
    width: 28px;
    height: 28px;
    object-fit: contain;
    filter: drop-shadow(0 0 8px rgba(239, 68, 68, 0.2));
}
.app-logo-lg {
    width: 60px;
    height: 60px;
    margin-bottom: 0.5rem;
}
.sidebar-brand-logo {
    width: 32px;
    height: 32px;
}


/* ---- NEW TOP BAR STREAK ---- */
.topbar-streak {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    background: rgba(249, 115, 22, 0.15);
    border: 1px solid rgba(249, 115, 22, 0.3);
    padding: 0.15rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
    color: #f97316;
    margin-left: 0.35rem;
}
.topbar-streak i {
    color: #f97316;
    font-size: 0.75rem;
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.top-bar-avatar-btn {
    background: none;
    border: 2px solid rgba(129,140,248,0.4);
    border-radius: 50%;
    width: 38px;
    height: 38px;
    cursor: pointer;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.2s, transform 0.15s;
    padding: 0;
}
.top-bar-avatar-btn:hover {
    border-color: var(--accent-primary, #818cf8);
    transform: scale(1.05);
}
.top-bar-avatar-btn img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}
.avatar-fallback {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #818cf8, #a78bfa);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.9rem;
    border-radius: 50%;
}

/* ---- SIDEBAR OVERLAY ---- */
.sidebar-overlay {
    position: fixed;
    inset: 0;
    z-index: 299;
    background: rgba(0,0,0,0.5);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.sidebar-overlay.active {
    opacity: 1;
    pointer-events: all;
}

/* ---- SIDEBAR DRAWER ---- */
.sidebar-drawer {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 300;
    width: 290px;
    max-width: 85vw;
    background: linear-gradient(180deg, rgba(15,12,41,0.98) 0%, rgba(22,16,56,0.98) 100%);
    border-right: 1px solid rgba(255,255,255,0.07);
    display: flex;
    flex-direction: column;
    transform: translateX(-100%);
    transition: transform 0.32s cubic-bezier(0.4,0,0.2,1);
    box-shadow: 4px 0 40px rgba(0,0,0,0.4);
    overflow: hidden;
}
.sidebar-drawer.open {
    transform: translateX(0);
}

.sidebar-header {
    padding: 1.25rem 1.25rem 0.75rem;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.sidebar-brand-icon {
    font-size: 1.6rem;
    color: var(--accent-primary, #818cf8);
}
.sidebar-brand-name {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary, #e2e8f0);
}
.sidebar-brand-tagline {
    font-size: 0.72rem;
    color: var(--text-secondary, #94a3b8);
    margin-top: 1px;
}

.sidebar-user-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: rgba(129,140,248,0.06);
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.sidebar-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(129,140,248,0.4);
    flex-shrink: 0;
}
.sidebar-avatar-fallback {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #818cf8, #a78bfa);
    display: none;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.1rem;
    flex-shrink: 0;
    border: 2px solid rgba(129,140,248,0.4);
}
.sidebar-user-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary, #e2e8f0);
}
.sidebar-user-email {
    font-size: 0.75rem;
    color: var(--text-secondary, #94a3b8);
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 180px;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem 0;
}
.sidebar-nav-item {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    width: 100%;
    padding: 0.85rem 1.25rem;
    background: none;
    border: none;
    color: var(--text-secondary, #94a3b8);
    font-size: 0.95rem;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    border-radius: 0;
    font-family: inherit;
}
.sidebar-nav-item i {
    width: 20px;
    font-size: 1rem;
    text-align: center;
    color: var(--text-secondary, #94a3b8);
    transition: color 0.15s;
}
.sidebar-nav-item:hover, .sidebar-nav-item.active-sidebar-item {
    background: rgba(129,140,248,0.1);
    color: var(--accent-primary, #818cf8);
}
.sidebar-nav-item:hover i, .sidebar-nav-item.active-sidebar-item i {
    color: var(--accent-primary, #818cf8);
}
.active-sidebar-item {
    border-left: 3px solid var(--accent-primary, #818cf8);
}

.sidebar-section-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-secondary, #94a3b8);
    padding: 0.75rem 1.25rem 0.25rem;
    opacity: 0.5;
}

.sidebar-info-block {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin: 0.5rem 1rem 0.5rem;
    padding: 0.85rem;
    background: rgba(129,140,248,0.06);
    border-radius: 10px;
    border: 1px solid rgba(129,140,248,0.1);
}
.sidebar-info-block i {
    color: var(--accent-primary, #818cf8);
    margin-top: 2px;
    flex-shrink: 0;
}
.sidebar-info-block strong {
    display: block;
    font-size: 0.85rem;
    color: var(--text-primary, #e2e8f0);
    margin-bottom: 4px;
}
.sidebar-info-block p {
    font-size: 0.8rem;
    color: var(--text-secondary, #94a3b8);
    line-height: 1.5;
    margin: 0;
}

.sidebar-footer {
    padding: 0.75rem 0 calc(0.75rem + env(safe-area-inset-bottom));
    border-top: 1px solid rgba(255,255,255,0.06);
}
.sidebar-streak {
    padding: 0.25rem 1.25rem 0.5rem;
    min-height: 24px;
}
.sidebar-logout-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.85rem 1.25rem;
    background: none;
    border: none;
    color: #ef4444;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s;
    font-family: inherit;
}
.sidebar-logout-btn:hover { background: rgba(239,68,68,0.08); }
.sidebar-logout-btn i { width: 20px; text-align: center; }

/* ---- BOTTOM NAV BAR ---- */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 250;
    height: calc(70px + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    display: flex;
    align-items: stretch;
    justify-content: space-around;
    background: rgba(10, 8, 32, 0.96);
    -webkit-
    border-top: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 -4px 24px rgba(0,0,0,0.4);
    pointer-events: auto;
}

.bottom-nav-item {
    background: none;
    border: none;
    color: rgba(148,163,184,0.6);
    font-size: 1.25rem;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    flex: 1;
    padding: 0.4rem 0.25rem 0.5rem;
    border-radius: 0;
    transition: color 0.2s, background 0.2s;
    min-height: 62px;
    position: relative;
    -webkit-tap-highlight-color: transparent;
}
.bottom-nav-item:active {
    background: rgba(255,255,255,0.04);
    transform: none;
}
.bottom-nav-label {
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    opacity: 0.8;
    margin-top: 1px;
}

.bottom-nav-dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--accent-primary, #818cf8);
    opacity: 0;
    transition: opacity 0.2s, transform 0.2s;
    transform: scale(0);
    position: absolute;
    top: 6px;
}

.bottom-nav-item.active {
    color: var(--accent-primary, #818cf8);
}
.bottom-nav-item.active .bottom-nav-dot {
    opacity: 1;
    transform: scale(1);
}
.bottom-nav-item.active i {
    filter: drop-shadow(0 0 8px rgba(129,140,248,0.7));
}
.bottom-nav-item.active .bottom-nav-label {
    color: var(--accent-primary, #818cf8);
}

/* ---- MAIN CONTENT LAYOUT ADJUSTMENTS ---- */
.app-container {
    display: flex;
    flex-direction: column;
    /* min-height: 100vh; */
}

.main-content.view-section,
.table-content.view-section,
.insights-view.view-section,
.insights-layout {
    padding-top: 0.8rem !important;
    padding-bottom: calc(80px + 1.5rem + env(safe-area-inset-bottom)) !important;
}

/* Hide the old top-nav / app-nav completely */
.top-nav, .app-nav, .backup-controls, .tagline,
.header-icon-group, .logo {
    display: none !important;
}

/* Consistent card spacing */
.glass-panel {
    margin-bottom: 0;
}

/* Extra clearance for mobile view to ensure headers aren't caught under the blur */
@media (max-width: 768px) {
    .main-content.view-section,
    .table-content.view-section,
    .insights-view.view-section {
        padding-top: 0.8rem !important;
        padding-bottom: 7.5rem !important;
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
    
    .pomodoro-panel {
        margin-bottom: 5rem !important;
    }
    
    #pomoFullscreenControls {
        gap: 0.5rem !important;
        padding: 0.6rem 1rem !important;
        width: 95%;
        max-width: 380px;
        justify-content: space-between;
    }
    
    .fs-cycle-text {
        margin-right: 0 !important;
        font-size: 0.95rem;
    }
    
    #btnFsExit {
        margin-left: 0 !important;
    }
    .view-section > h2:first-child,
    .view-section > h1:first-child {
        margin-top: 0;
    }
}

/* ---- MOBILE SPACING TWEAKS ---- */
@media (max-width: 480px) {
    .bottom-nav-item {
        font-size: 1.1rem;
        gap: 2px;
    }
    .bottom-nav-label { font-size: 0.58rem; }
    .top-bar-title span { font-size: 1rem; }
}

/* Ensure Pomodoro modal isn't hidden under bottom nav */
.pomodoro-modal-backdrop {
    z-index: 400 !important;
}

