/* 
 * Mobile Canva-Style Interface
 * Clean, modern mobile design with purple gradient theme
 * Includes: Hamburger Menu, Top Navigation, FAB with Quick Actions
 */

/* Mobile-only styles - will not affect desktop */
@media screen and (max-width: 768px) {
    /* CSS Variables for consistent theming */
    :root {
        --mobile-primary: #667eea;
        --mobile-secondary: #764ba2;
        --mobile-accent: #8b5cf6;
        --mobile-bg: #f8fafc;
        --mobile-surface: rgba(255, 255, 255, 0.95);
        --mobile-shadow: 0 4px 20px rgba(102, 126, 234, 0.15);
        --mobile-border-radius: 16px;
        --mobile-z-overlay: 9998;
        --mobile-z-sidebar: 9999;
        --mobile-z-fab: 10000;
        --mobile-z-modal: 10001;
    }

    /* Hide desktop sidebar on mobile */
    .unified-sidebar,
    .desktop-sidebar,
    .sidebar-desktop {
        display: none !important;
    }

    /* Mobile Top Navigation Bar */
    .mobile-top-nav {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: 60px;
        background: linear-gradient(135deg, var(--mobile-primary) 0%, var(--mobile-secondary) 100%);
        backdrop-filter: blur(20px);
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        z-index: var(--mobile-z-sidebar);
        display: flex;
        align-items: center;
        padding: 0 16px;
        box-shadow: var(--mobile-shadow);
    }

    /* Hamburger Menu Button */
    .mobile-hamburger {
        width: 44px;
        height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: rgba(255, 255, 255, 0.2);
        border: none;
        border-radius: 12px;
        cursor: pointer;
        transition: all 0.3s ease;
        backdrop-filter: blur(10px);
    }

    .mobile-hamburger:hover {
        background: rgba(255, 255, 255, 0.3);
        transform: scale(1.05);
    }

    .mobile-hamburger-icon {
        width: 20px;
        height: 16px;
        position: relative;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
    }

    .mobile-hamburger-line {
        width: 100%;
        height: 2px;
        background: white;
        border-radius: 2px;
        transition: all 0.3s ease;
    }

    /* Animated hamburger to X */
    .mobile-hamburger.active .mobile-hamburger-line:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }

    .mobile-hamburger.active .mobile-hamburger-line:nth-child(2) {
        opacity: 0;
    }

    .mobile-hamburger.active .mobile-hamburger-line:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px);
    }

    /* Top Nav Title */
    .mobile-nav-title {
        flex: 1;
        text-align: center;
        color: white;
        font-size: 18px;
        font-weight: 600;
        margin: 0 16px;
    }

    /* Mobile History Navigation Button (Top Nav) */
    .mobile-history-nav-btn {
        width: 44px;
        height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: rgba(255, 255, 255, 0.2);
        border: none;
        border-radius: 12px;
        cursor: pointer;
        transition: all 0.3s ease;
        backdrop-filter: blur(10px);
        color: white;
        font-size: 18px;
    }

    .mobile-history-nav-btn:hover,
    .mobile-history-nav-btn:focus,
    .mobile-history-nav-btn:active {
        background: rgba(255, 255, 255, 0.3);
        transform: scale(1.05);
        outline: none;
    }

    /* Mobile Sidebar Overlay */
    .mobile-sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        backdrop-filter: blur(4px);
        z-index: var(--mobile-z-overlay);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }

    .mobile-sidebar-overlay.active {
        opacity: 1;
        visibility: visible;
    }

    /* Mobile Sidebar Panel */
    .mobile-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: 75vw;
        max-width: 280px;
        height: 100vh;
        background: linear-gradient(135deg, var(--mobile-primary) 0%, var(--mobile-secondary) 100%);
        z-index: var(--mobile-z-sidebar);
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
        overflow-y: auto;
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.1);
    }

    .mobile-sidebar.active {
        transform: translateX(0);
    }

    /* Sidebar Header */
    .mobile-sidebar-header {
        padding: 20px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        background: rgba(255, 255, 255, 0.1);
        position: relative;
    }

    .mobile-sidebar-logo {
        color: white;
        font-size: 20px;
        font-weight: 700;
        display: flex;
        align-items: center;
        gap: 12px;
    }

    /* Ensure any logo images in mobile sidebar stay constrained */
    .mobile-sidebar-logo img {
        width: 32px;
        height: 32px;
        object-fit: contain;
        flex-shrink: 0;
    }

    .mobile-sidebar-subtitle {
        color: rgba(255, 255, 255, 0.8);
        font-size: 14px;
        margin-top: 4px;
    }

    /* Sidebar Close Button */
    .mobile-sidebar-close {
        position: absolute;
        top: 15px;
        right: 15px;
        background: rgba(255, 255, 255, 0.2);
        border: none;
        border-radius: 50%;
        width: 36px;
        height: 36px;
        color: white;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 16px;
        transition: all 0.2s ease;
        backdrop-filter: blur(10px);
        z-index: 10;
    }

    .mobile-sidebar-close:hover {
        background: rgba(255, 255, 255, 0.3);
        transform: scale(1.1);
    }

    /* Sidebar Navigation */
    .mobile-sidebar-nav {
        padding: 20px 0;
    }

    .mobile-nav-section {
        margin-bottom: 24px;
    }

    .mobile-nav-section-title {
        color: rgba(255, 255, 255, 0.7);
        font-size: 12px;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 1px;
        padding: 0 20px 8px 20px;
    }

    .mobile-nav-item {
        display: flex;
        align-items: center;
        padding: 12px 20px;
        color: white;
        text-decoration: none;
        transition: all 0.2s ease;
        border-left: 3px solid transparent;
    }

    .mobile-nav-item:hover {
        background: rgba(255, 255, 255, 0.1);
        border-left-color: white;
        color: white;
        text-decoration: none;
    }

    .mobile-nav-item.active {
        background: rgba(255, 255, 255, 0.15);
        border-left-color: white;
    }

    .mobile-nav-icon {
        width: 20px;
        height: 20px;
        margin-right: 12px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .mobile-nav-text {
        font-size: 16px;
        font-weight: 500;
    }

    /* Mobile Dropdown Styles */
    .mobile-nav-dropdown {
        margin-bottom: 8px;
    }

    .mobile-nav-dropdown-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 14px 20px;
        color: rgba(255, 255, 255, 0.9);
        cursor: pointer;
        transition: all 0.3s ease;
        border-radius: 8px;
        margin: 0 8px;
        font-weight: 500;
        background: rgba(255, 255, 255, 0.05);
    }

    .mobile-nav-dropdown-header:hover {
        background: rgba(255, 255, 255, 0.1);
        color: white;
        transform: translateX(2px);
    }

    .mobile-nav-dropdown-title {
        display: flex;
        align-items: center;
        gap: 12px;
    }

    .mobile-dropdown-arrow {
        transition: transform 0.3s ease;
        font-size: 14px;
        opacity: 0.7;
        color: rgba(255, 255, 255, 0.8);
    }

    .mobile-nav-dropdown-content {
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
        background: rgba(255, 255, 255, 0.03);
        margin: 0 8px;
        border-radius: 0 0 8px 8px;
    }

    .mobile-dropdown-item {
        padding-left: 52px !important;
        font-size: 15px;
        opacity: 0.9;
        border-left: 2px solid rgba(255, 255, 255, 0.2);
        margin-left: 20px;
        margin-bottom: 2px;
    }

    .mobile-dropdown-item:hover {
        background: rgba(255, 255, 255, 0.08);
        padding-left: 57px !important;
        transform: translateX(3px);
        border-left-color: white;
    }

    /* FAB REMOVED - No longer needed */



    /* Body padding for top nav */
    body.mobile-nav-active {
        padding-top: 60px;
    }

    /* Quick Action Modal */
    .mobile-quick-modal {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        backdrop-filter: blur(4px);
        z-index: var(--mobile-z-modal);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        display: flex;
        align-items: flex-end;
        padding: 20px;
    }

    .mobile-quick-modal.active {
        opacity: 1;
        visibility: visible;
    }

    .mobile-quick-modal-content {
        width: 100%;
        background: white;
        border-radius: var(--mobile-border-radius);
        padding: 24px;
        transform: translateY(100%);
        transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    }

    .mobile-quick-modal.active .mobile-quick-modal-content {
        transform: translateY(0);
    }

    /* Animation classes */
    .mobile-slide-up {
        animation: mobileSlideUp 0.3s ease-out;
    }

    .mobile-fade-in {
        animation: mobileFadeIn 0.3s ease-out;
    }

    @keyframes mobileSlideUp {
        from {
            transform: translateY(100%);
            opacity: 0;
        }
        to {
            transform: translateY(0);
            opacity: 1;
        }
    }

    @keyframes mobileFadeIn {
        from { opacity: 0; }
        to { opacity: 1; }
    }

    /* Responsive breakpoints */
    @media screen and (max-width: 480px) {
        .mobile-sidebar {
            width: 75vw;
            max-width: 75vw;
        }
        

    }
}

/* Hide mobile elements on desktop */
@media screen and (min-width: 769px) {
    .mobile-top-nav,
    .mobile-sidebar-overlay,
    .mobile-sidebar,
    .mobile-quick-modal {
        display: none !important;
    }
}