/* =========================================
   LEOCONS MOBILE ADAPTATION
   Target: Smartphones & Tablets
   ========================================= */

/* =========================================
   TABLET & SMALLER (max-width: 1024px)
   ========================================= */

@media (max-width: 1024px) {
    /* Adjust Container padding */
    .container {
        padding: 0 15px;
    }
    
    /* Hero Text Size adjustment */
    .hero-title {
        font-size: 3.5rem;
    }

    .hero-visual {
        transform: scale(0.8);
    }
}

/* =========================================
   MOBILE DEVICES (max-width: 768px)
   ========================================= */

@media (max-width: 768px) {
    
    /* --- NAVIGATION --- */
    .desktop-nav, 
    .auth-buttons {
        display: none; /* Hide default nav */
    }

    .burger-menu {
        display: flex; /* Show burger */
        z-index: 1002;
    }

    /* Mobile Drawer Menu (Hidden by default, toggled via JS class) */
    .mobile-nav-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background: rgba(0,0,0,0.95);
        backdrop-filter: blur(10px);
        z-index: 1001;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 30px;
        opacity: 0;
        visibility: hidden;
        transition: 0.3s ease;
    }

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

    .mobile-nav-link {
        font-family: var(--font-heading);
        font-size: 2rem;
        color: white;
        text-decoration: none;
        text-transform: uppercase;
    }

    .mobile-nav-link:hover {
        color: var(--accent-primary);
    }

    /* --- HERO SECTION --- */
    .hero-section {
        flex-direction: column;
        justify-content: center;
        text-align: center;
        padding-top: 100px;
        height: auto;
        min-height: 100vh;
    }

    .hero-content {
        flex-direction: column-reverse; /* Visual on top or bottom? Let's keep text on top for SEO */
    }

    .hero-text-wrapper {
        margin-top: 40px;
    }

    .hero-visual {
        width: 100%;
        height: 250px;
        margin-bottom: 20px;
    }

    .cube-wrapper {
        width: 120px;
        height: 120px; /* Smaller cube */
    }

    .face {
        width: 120px;
        height: 120px;
        font-size: 1.5rem;
    }
    
    .face.front  { transform: translateZ(60px); }
    .face.back   { transform: rotateY(180deg) translateZ(60px); }
    .face.right  { transform: rotateY(90deg) translateZ(60px); }
    .face.left   { transform: rotateY(-90deg) translateZ(60px); }
    .face.top    { transform: rotateX(90deg) translateZ(60px); }
    .face.bottom { transform: rotateX(-90deg) translateZ(60px); }

    /* --- GRIDS (Features / Pricing) --- */
    .features-grid, 
    .pricing-wrapper {
        grid-template-columns: 1fr; /* Stack vertically */
    }

    .feature-card {
        padding: 30px 20px;
    }

    /* --- DASHBOARD --- */
    .dash-header-inner {
        flex-direction: row; /* Keep row but simplify */
    }
    
    .page-title, 
    .divider,
    .user-info .user-email {
        display: none; /* Hide extra info on mobile header */
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr; /* 2 cols for stats */
    }
    
    .stats-grid .stat-card:last-child {
        grid-column: span 2; /* Plan card takes full width */
    }

    .filter-controls {
        display: none; /* Hide filters to save space */
    }
}

/* =========================================
   EDITOR MOBILE LAYOUT (The Hard Part)
   ========================================= */

@media (max-width: 768px) {
    
    body.editor-mode {
        height: 100vh;
        overflow: hidden;
    }

    /* Header Compact */
    .editor-header {
        padding: 0 10px;
        height: 50px;
        justify-content: space-between;
    }

    .device-switcher,
    .project-meta,
    .sep {
        display: none !important; /* Hide non-essential controls */
    }

    /* Workspace takes full screen */
    .editor-layout {
        flex-direction: column;
        position: relative;
    }

    .workspace {
        padding: 10px;
        background-size: 10px 10px; /* Smaller grid */
    }

    /* Canvas mimics actual phone screen */
    .canvas-frame {
        width: 100% !important;
        height: 100% !important;
        border: none;
        border-radius: 0;
        box-shadow: none;
    }

    /* --- SIDEBARS BECOME BOTTOM SHEETS --- */
    
    .sidebar {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 50vh; /* Half screen height */
        z-index: 500;
        background: #0a0a0a;
        border-top: 1px solid var(--accent-primary);
        transform: translateY(110%); /* Hidden by default */
        transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
        display: flex;
        flex-direction: column;
    }

    .sidebar.active-sheet {
        transform: translateY(0);
        box-shadow: 0 -10px 40px rgba(0,0,0,0.8);
    }

    /* Mobile Toolbar at Bottom (New Element for Mobile) */
    .mobile-editor-toolbar {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 60px;
        background: #000;
        border-top: 1px solid #333;
        display: flex;
        justify-content: space-around;
        align-items: center;
        z-index: 600;
    }
    
    /* Move sidebar tabs to this new toolbar visually (via JS Logic or CSS hacks) */
    /* For now, we assume sidebar tabs are hidden inside the sidebar and we use the bottom bar triggers */

    .sidebar-tabs {
        display: none; /* Hide desktop vertical tabs */
    }
    
    .sidebar-content {
        padding: 20px;
        overflow-y: auto;
    }

    /* Adjust Add Elements Grid */
    .component-grid {
        grid-template-columns: repeat(4, 1fr); /* 4 items per row */
        gap: 10px;
    }
    
    .draggable-item {
        font-size: 0.7rem;
        padding: 10px 5px;
    }
    
    .icon-box {
        width: 30px;
        height: 30px;
        font-size: 0.8rem;
    }

    /* Properties Panel mobile adjustments */
    .right-sidebar {
        height: 40vh; /* Smaller for properties */
    }
}
