/* ========================================
   MOBILE-ONLY NAVIGATION STYLES
   ======================================== */

/* Mobile Home Button - Only visible on mobile */
.mobile-home-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    color: var(--color-gray-700);
    font-size: 1.25rem;
    cursor: pointer;
    transition: var(--transition);
    border-radius: var(--radius-md);
}

.mobile-home-btn:hover {
    background: var(--color-gray-100);
    color: var(--color-accent);
}

.mobile-home-btn:active {
    transform: scale(0.95);
}

/* Mobile Profile Menu - Only visible on mobile */
.mobile-profile-menu {
    display: none;
    position: relative;
}

.mobile-profile-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    color: var(--color-gray-700);
    font-size: 1.125rem;
    cursor: pointer;
    transition: var(--transition);
    border-radius: var(--radius-md);
}

.mobile-profile-btn:hover,
.mobile-profile-btn.active {
    background: var(--color-gray-100);
    color: var(--color-accent);
}

.mobile-profile-btn:active {
    transform: scale(0.95);
}

.mobile-profile-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--color-gray-200);
    min-width: 160px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 1000;
}

.mobile-profile-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.mobile-profile-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.875rem 1rem;
    background: transparent;
    border: none;
    color: var(--color-gray-700);
    font-size: 0.9375rem;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: var(--transition);
    border-radius: var(--radius-lg);
}

.mobile-profile-option:hover {
    background: var(--color-gray-50);
    color: var(--color-danger);
}

.mobile-profile-option i {
    font-size: 1rem;
    width: 20px;
    text-align: center;
}

/* Mobile: Show mobile elements, hide desktop elements */
@media (max-width: 768px) {
    /* Show mobile navigation elements */
    .mobile-home-btn,
    .mobile-profile-menu {
        display: flex;
    }
    
    /* Hide desktop logo on mobile */
    .header-logo {
        display: none;
    }
    
    /* Hide desktop search on mobile */
    .header-search {
        display: none;
    }
    
    /* Hide desktop actions on mobile */
    .header-actions-desktop {
        display: none !important;
    }
    
    /* Make header content flush - MINIMAL padding for true edge-to-edge */
    .header-content {
        justify-content: space-between;
        padding: 0 0.625rem !important; /* Minimal: 10px for flush appearance */
        max-width: 100% !important;
    }
    
    /* Ensure header is truly full-width */
    .app-header {
        width: 100vw !important;
        max-width: 100vw !important;
        margin: 0 !important;
        padding: 0.875rem 0 !important; /* Vertical padding only */
        position: relative;
        left: 0;
        right: 0;
    }
    
    /* Breadcrumbs - match header spacing on mobile */
    .breadcrumbs {
        padding: 1rem 0.625rem 0 !important; /* Match header horizontal padding */
        max-width: 100% !important;
    }
    
    /* Fix breadcrumb alignment - ensure arrows align with text */
    .breadcrumb-list {
        align-items: center !important;
        line-height: 1.4 !important; /* Consistent line height */
    }
    
    .breadcrumb-item {
        display: inline-flex !important;
        align-items: center !important;
        gap: 0.375rem !important;
        line-height: 1.4 !important;
    }
    
    .breadcrumb-separator {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        line-height: 1 !important; /* Remove extra line height from icon */
    }
    
    .breadcrumb-separator i {
        vertical-align: middle !important; /* Force icon alignment */
        line-height: 1 !important;
        display: inline-block !important;
    }
    
    .breadcrumb-current {
        line-height: 1.4 !important;
    }
}

/* Desktop: Show desktop elements, hide mobile elements */
@media (min-width: 769px) {
    .mobile-home-btn,
    .mobile-profile-menu {
        display: none !important;
    }
}

/* ========================================
   MOBILE DASHBOARD IMPROVEMENTS
   ======================================== */

@media (max-width: 768px) {
    /* MOBILE DASHBOARD WRAPPER ALIGNMENT - Ensure centered layout */
    
    /* Main pages - ensure no left offset */
    #dashboardPage,
    #categoryPage,
    #lessonPage {
        margin: 0 !important;
        padding: 0 !important;
        width: 100vw !important;
        max-width: 100vw !important;
        overflow-x: hidden !important;
    }
    
    /* Page wrappers - ensure no offset */
    .app-layout,
    .lesson-player-page {
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    
    /* Content container - ensure centered */
    .content-container {
        margin: 0 auto !important;
        padding: 1.25rem 0 !important;
        width: 100vw !important;
        max-width: 100vw !important;
    }
    
    /* Snapshot section wrapper - FORCE 90VW CENTERED */
    .quick-stats {
        width: 90vw !important;
        max-width: 90vw !important;
        margin-left: auto !important;
        margin-right: auto !important;
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        grid-template-rows: repeat(2, auto) !important;
        gap: 0.5rem !important;
        padding: 0 !important;
        margin-bottom: 0.75rem !important;
        box-sizing: border-box !important; /* Ensure width includes any border */
        position: relative !important; /* Establish positioning context */
        left: 0 !important; /* Prevent any left offset */
        right: 0 !important; /* Prevent any right offset */
    }
    
    /* Category section wrapper - FORCE 90VW CENTERED */
    .category-grid {
        width: 90vw !important;
        max-width: 90vw !important;
        margin-left: auto !important;
        margin-right: auto !important;
        padding: 0 !important;
    }
    
    /* Hero/Welcome section - add more breathing room on mobile */
    .dashboard-hero {
        width: calc(100vw - 2rem) !important; /* Subtract 2rem total (1rem each side) */
        max-width: calc(100vw - 2rem) !important;
        margin-left: auto !important;
        margin-right: auto !important;
        box-sizing: border-box !important;
    }
    
    /* Section header (Your Training Library) - match intro breathing room */
    .section-header {
        width: calc(100vw - 2rem) !important; /* Same as intro */
        max-width: calc(100vw - 2rem) !important;
        margin-left: auto !important;
        margin-right: auto !important;
        box-sizing: border-box !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
    
    /* Hero actions (buttons) - ensure they align with content */
    .hero-actions {
        padding: 0;
    }
    
    /* Compact snapshot cards */
    .stat-card {
        padding: 0.5rem;
        margin: 0 !important; /* Remove any card margins that could affect grid alignment */
        box-sizing: border-box !important; /* Ensure padding is included in card width */
    }
    
    .stat-icon {
        width: 20px;
        height: 20px;
        font-size: 0.625rem;
        margin-bottom: 0.25rem;
    }
    
    .stat-value {
        font-size: 1.125rem;
        margin-bottom: 0.0625rem;
    }
    
    .stat-label {
        font-size: 0.5rem;
        line-height: 1.1;
    }
}

/* Very small screens (< 400px) */
@media (max-width: 400px) {
    .header-content {
        padding: 0 0.5rem !important;
    }
    
    /* Ensure centered layout on very small screens */
    #dashboardPage,
    .content-container {
        width: 100vw !important;
        max-width: 100vw !important;
        margin: 0 auto !important;
    }
    
    /* Keep 90vw wrapper width with centered alignment */
    .category-grid,
    .quick-stats {
        width: 90vw !important;
        max-width: 90vw !important;
        margin-left: auto !important;
        margin-right: auto !important;
        padding: 0 !important;
    }
    
    .stat-value {
        font-size: 1rem;
    }
    
    .stat-label {
        font-size: 0.4375rem;
    }
}
