/* 
 * 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 Newsfeed Menu Button (Top Nav) */
    .mobile-newsfeed-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-newsfeed-nav-btn:hover,
    .mobile-newsfeed-nav-btn:focus,
    .mobile-newsfeed-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(0, 0, 0, 0.05);
        background: linear-gradient(135deg, #fafaff 0%, #f8f9ff 50%, #fafaff 100%);
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

    .mobile-sidebar-logo {
        display: flex;
        align-items: center;
        flex: 1;
    }

    /* Style the logo image */
    .mobile-sidebar-logo-img {
        height: 27px !important;
        max-width: 120px !important;
        width: auto !important;
        object-fit: contain !important;
        flex-shrink: 0 !important;
    }

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

    /* Sidebar Close Button - now inline */
    .mobile-sidebar-close {
        background: rgba(0, 0, 0, 0.05);
        border: none;
        border-radius: 50%;
        width: 36px;
        height: 36px;
        color: #666;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 16px;
        transition: all 0.2s ease;
        backdrop-filter: blur(10px);
        flex-shrink: 0;
    }

    .mobile-sidebar-close:hover {
        background: rgba(0, 0, 0, 0.1);
        color: #333;
        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; }
    }

    /* Mobile Newsfeed Overlay */
    .mobile-nav-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: var(--mobile-z-modal);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }

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

    .mobile-nav-overlay-backdrop {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        backdrop-filter: blur(4px);
    }

    .mobile-nav-overlay-content {
        position: absolute;
        top: 0;
        right: 0;
        width: 280px;
        height: 100%;
        background: white;
        box-shadow: -2px 0 20px rgba(0, 0, 0, 0.1);
        transform: translateX(100%);
        transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
        overflow-y: auto;
    }

    .mobile-nav-overlay.active .mobile-nav-overlay-content {
        transform: translateX(0);
    }

    .mobile-nav-overlay-header {
        padding: 20px;
        background: linear-gradient(135deg, var(--mobile-primary) 0%, var(--mobile-secondary) 100%);
        color: white;
        display: flex;
        justify-content: space-between;
        align-items: center;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .mobile-nav-overlay-header h3 {
        margin: 0;
        font-size: 18px;
        font-weight: 600;
    }

    .mobile-nav-overlay-close {
        background: rgba(255, 255, 255, 0.2);
        border: none;
        border-radius: 8px;
        width: 36px;
        height: 36px;
        display: flex;
        align-items: center;
        justify-content: center;
        color: white;
        cursor: pointer;
        transition: all 0.3s ease;
    }

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

    .mobile-nav-overlay-body {
        padding: 20px;
    }

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

    .mobile-nav-overlay-section h4 {
        margin: 0 0 12px 0;
        font-size: 16px;
        font-weight: 600;
        color: #374151;
        border-bottom: 2px solid #f3f4f6;
        padding-bottom: 8px;
    }

    .mobile-nav-overlay-options {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

    .mobile-nav-option {
        background: white;
        border: 1px solid #e5e7eb;
        border-radius: 12px;
        padding: 16px;
        display: flex;
        align-items: center;
        gap: 12px;
        cursor: pointer;
        transition: all 0.3s ease;
        text-align: left;
        width: 100%;
    }

    .mobile-nav-option:hover {
        background: #f8fafc;
        border-color: var(--mobile-primary);
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
    }

    .mobile-nav-option i {
        width: 20px;
        height: 20px;
        display: flex;
        align-items: center;
        justify-content: center;
        color: var(--mobile-primary);
        font-size: 16px;
    }

    .mobile-nav-option span {
        font-size: 15px;
        font-weight: 500;
        color: #374151;
        flex: 1;
    }

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

    }
}

/* MOBILE NOTIFICATION BADGE */
.mobile-notification-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: linear-gradient(135deg, #e53e3e 0%, #c53030 100%);
    color: white;
    border-radius: 50%;
    min-width: 20px;
    height: 20px;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    border: 2px solid white;
}

.mobile-notification-pulse {
    animation: mobilePulse 2s infinite;
}

@keyframes mobilePulse {
    0% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.1); }
    100% { opacity: 1; transform: scale(1); }
}

.mobile-notifications-item {
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.mobile-notifications-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.mobile-nav-icon {
    position: relative;
}

/* 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;
    }
}