/* ============================================
   NAVIGATION CSS
   Sidebar, header, mobile menu, and nav components
   Extracted from base.html - Session 6 (Jan 2026)
   ============================================ */

/* ============================================
   NAVBAR & LOGO
   ============================================ */

.navbar-brand {
    font-weight: bold;
    font-size: 1.5rem;
}

.app-logo {
    height: 40px;
    width: auto;
    max-width: 180px;
    object-fit: contain;
}

@media (max-width: 768px) {
    .app-logo {
        height: 32px;
        max-width: 140px;
    }
}

/* ============================================
   NAV TABS (Legacy - kept for compatibility)
   ============================================ */

.nav-tab-wrapper {
    border-bottom: 1px solid var(--border);
    margin-bottom: 20px;
}

.nav-tab {
    display: inline-block;
    padding: 12px 20px;
    text-decoration: none;
    color: var(--info);
    border: 1px solid transparent;
    border-bottom: none;
    margin-right: 5px;
    background: var(--gray-50);
}

.nav-tab:hover {
    color: var(--info-dark);
    text-decoration: none;
}

.nav-tab-active {
    background: var(--card-bg);
    border-color: var(--border);
    color: var(--text-primary);
    font-weight: 600;
}

/* ============================================
   SCORE & RECOMMENDATION CARDS (Legacy)
   ============================================ */

.opportunity-score {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.score-bar {
    width: 80px;
    height: 8px;
    background: var(--gray-200);
    border-radius: 4px;
    overflow: hidden;
}

.score-fill {
    height: 100%;
    border-radius: 4px;
}

.recommendation-card {
    border: 1px solid var(--border);
    border-radius: 6px;
    margin-bottom: 15px;
    background: var(--card-bg);
}

.recommendation-header {
    padding: 15px;
    border-bottom: 1px solid var(--border-light);
    background: var(--gray-50);
}

.recommendation-content {
    padding: 15px;
}

.recommendation-actions {
    padding: 15px;
    background: var(--gray-50);
    border-top: 1px solid var(--border-light);
}

.badge-type {
    font-size: 0.75rem;
    padding: 4px 8px;
}

.btn-group-sm .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

/* ============================================
   SIDEBAR BASE STYLES
   ============================================ */

.sidebar {
    background: var(--gray-50);
    min-height: 100vh;
    padding: 0;
}

.main-content {
    padding: var(--spacing-xl);
    background: var(--background);
    min-height: calc(100vh - var(--header-height));
    transition: max-width 0.3s ease, flex 0.3s ease;
}

.count-badge {
    background: var(--gray-500);
    color: white;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 0.75rem;
    margin-left: 5px;
}

/* ============================================
   MOBILE MENU TOGGLE
   ============================================ */

.mobile-menu-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    padding: 0;
    margin-right: var(--spacing-md);
    transition: all var(--transition-base);
}

.mobile-menu-toggle:hover {
    background: var(--primary-light);
    border-color: var(--primary);
}

.mobile-menu-toggle i[data-lucide] {
    width: 24px;
    height: 24px;
}

/* ============================================
   SIDEBAR OVERLAY (Mobile backdrop)
   ============================================ */

.sidebar-overlay {
    display: none;
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity var(--transition-base);
}

.sidebar-overlay.show {
    display: block;
    opacity: 1;
}

/* ============================================
   IMPERSONATION BANNER TEXT CONTROL
   ============================================ */

.exit-mobile {
    display: none;
}

@media (min-width: 768px) {
    .exit-mobile {
        display: none;
    }
    .exit-full {
        display: inline;
    }
}

/* User dropdown button - center icon */
.app-header-actions .dropdown .btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* ============================================
   MOBILE RESPONSIVE SIDEBAR
   ============================================ */

@media (max-width: 768px) {
    /* Impersonation: Hide full text, show "Exit" only */
    .exit-full {
        display: none;
    }
    .exit-mobile {
        display: inline;
    }

    /* Show mobile menu toggle */
    .mobile-menu-toggle {
        display: flex;
    }

    /* Hide top navigation links on mobile */
    .app-header-nav {
        display: none;
    }

    /* Hide username text in dropdown button, keep icon */
    .app-header-actions .dropdown .btn-secondary {
        padding: var(--spacing-sm);
        min-width: auto;
    }

    .app-header-actions .dropdown .btn-secondary .dropdown-toggle::after {
        display: none;
    }

    .app-header-actions .dropdown .btn-secondary {
        font-size: 0;
    }

    .app-header-actions .dropdown .btn-secondary i[data-lucide] {
        font-size: initial;
    }

    /* Sidebar: Fixed position, hidden by default */
    /* MUST use same selectors as design-system.css for CSS specificity */
    .sidebar,
    aside.sidebar,
    aside.sidebar.col-md-2,
    #mobileSidebar {
        position: fixed !important;
        left: -100% !important;
        top: var(--header-height);
        width: 280px !important;
        max-width: 280px !important;
        flex: 0 0 280px !important;
        height: calc(100vh - var(--header-height));
        transition: left var(--transition-base);
        z-index: 1000;
        overflow-y: auto;
        box-shadow: none;
        background: var(--card-bg);
    }

    /* Sidebar visible state - shown when hamburger menu clicked */
    .sidebar.show,
    aside.sidebar.show,
    aside.sidebar.col-md-2.show,
    #mobileSidebar.show {
        left: 0 !important;
        box-shadow: var(--shadow-xl);
    }

    /* Main content: Full width on mobile */
    .main-content,
    .col-md-10 {
        max-width: 100% !important;
        flex: 0 0 100% !important;
        width: 100% !important;
        margin-left: 0 !important;
        padding: var(--spacing-lg) !important;
    }

    /* Hide sidebar collapse toggle on mobile (not needed - hamburger does this) */
    .sidebar-collapse-toggle {
        display: none !important;
    }
}

/* ============================================
   DESKTOP SIDEBAR BEHAVIOR
   ============================================ */

@media (min-width: 768px) {
    .mobile-menu-toggle {
        display: none !important;
    }

    .sidebar-overlay {
        display: none !important;
    }

    .sidebar {
        position: sticky !important;
        top: 0;
        left: auto !important;
        align-self: flex-start;
        max-height: 100vh;
        overflow-y: auto;
    }
}

/* ============================================
   INFO CARD - About section for pages
   ============================================ */

.info-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
}

.info-card h3 {
    margin: 0 0 var(--spacing-sm) 0;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-size: var(--font-size-base);
}

.info-card p {
    color: var(--text-secondary);
    margin: 0;
    font-size: var(--font-size-sm);
}

/* ============================================
   QUICK TIP CARD - Post-it Note Style (Dismissable)
   ============================================ */

.tip-card {
    position: relative;
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary-light) 100%);
    border: none;
    border-left: 4px solid var(--primary);
    border-radius: var(--radius-md);
    padding: var(--spacing-lg);
    padding-right: calc(var(--spacing-lg) + 32px);
    margin-bottom: var(--spacing-xl);
    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.06),
        0 4px 16px rgba(255, 193, 7, 0.08);
}

.tip-card h3 {
    margin: 0 0 var(--spacing-sm) 0;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-size: var(--font-size-base);
    font-weight: 600;
    color: var(--gray-700);
}

.tip-card h3 i[data-lucide] {
    color: var(--primary);
}

.tip-card p {
    color: var(--gray-600);
    margin: 0;
    font-size: var(--font-size-sm);
    line-height: 1.5;
}

.tip-card-dismiss {
    position: absolute;
    top: var(--spacing-sm);
    right: var(--spacing-sm);
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--gray-500);
    cursor: pointer;
    opacity: 0.6;
    transition: all 0.2s;
}

.tip-card-dismiss:hover {
    opacity: 1;
    background: rgba(0, 0, 0, 0.05);
    color: var(--gray-700);
}

.tip-card-dismiss i[data-lucide] {
    width: 16px;
    height: 16px;
}

/* Slide-up animation for tip card dismissal */
.tip-card.dismissing {
    animation: tipCardDismiss 0.3s ease-out forwards;
}

@keyframes tipCardDismiss {
    0% {
        opacity: 1;
        transform: translateY(0);
        max-height: 200px;
        margin-bottom: var(--spacing-xl);
        padding: var(--spacing-lg);
    }
    100% {
        opacity: 0;
        transform: translateY(-10px);
        max-height: 0;
        margin-bottom: 0;
        padding: 0;
        border-width: 0;
    }
}

/* Collapsed tip card - compact yellow box inside h1 */
.tip-card.collapsed {
    position: static;
    padding: 10px 16px 10px 14px;
    margin: 0;
    margin-left: var(--spacing-sm);
    background: var(--primary-light);
    border: none;
    border-left: 4px solid var(--primary);
    border-radius: var(--radius-md);
    box-shadow: none;
    display: inline-flex;
    align-items: center;
}

.tip-card.collapsed h3,
.tip-card.collapsed p,
.tip-card.collapsed .tip-card-dismiss {
    display: none;
}

.tip-card.collapsed .tip-restore-link {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--gray-700);
    font-size: 14px;
    font-weight: normal;
    text-decoration: none;
    cursor: pointer;
    transition: color 0.2s;
    white-space: nowrap;
}

.tip-card.collapsed .tip-restore-link:hover {
    color: var(--gray-800);
}

.tip-card.collapsed .tip-restore-link i[data-lucide],
.tip-card.collapsed .tip-restore-link svg {
    width: 18px !important;
    height: 18px !important;
    min-width: 18px;
    min-height: 18px;
    color: var(--gray-600);
}

/* Undo toast notification */
.tip-undo-toast {
    position: fixed;
    bottom: var(--spacing-xl);
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    background: var(--gray-800);
    color: white;
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-md);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1050;
    animation: toastSlideUp 0.3s ease-out;
}

.tip-undo-toast span {
    font-size: var(--font-size-sm);
}

.tip-undo-toast button {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: var(--primary);
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-sm);
    font-size: var(--font-size-sm);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.tip-undo-toast button:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary);
}

.tip-undo-toast.hiding {
    animation: toastSlideDown 0.3s ease-out forwards;
}

@keyframes toastSlideUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

@keyframes toastSlideDown {
    from {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
    to {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
}
