/* Responsive Styles for Novaweb */

/* Tablet Styles (max-width: 1024px) */
@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 200px 1fr 200px; /* Reduced sidebars from 220px */
        gap: 10px; /* Reduced gap from 15px */
        width: 98%; /* Increased width usage from 95% */
    }

    .shortcuts-grid {
        grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); /* Dynamic columns instead of fixed 3 */
        gap: 15px;
    }

    #indicators-view .indicators-container {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Mobile Styles (max-width: 768px) */
@media (max-width: 768px) {
    .dashboard-grid {
        display: flex;
        flex-direction: column;
        width: 100%;
        padding: 0 10px;
    }

    .dashboard-left-column,
    .dashboard-center-column,
    .dashboard-right-column {
        width: 100%;
    }

    /* Reorder for mobile if needed (Optional, keeping default for now) */
    /* 
    .dashboard-center-column { order: -1; } 
    */

    .shortcuts-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
        padding: 10px;
    }

    .top-bar {
        padding: 0 10px;
    }

    .atlas-logo span {
        display: none;
        /* Hide logo text on small screens */
    }

    .workspace-selector {
        margin-right: 5px;
        padding: 6px 8px;
    }

    .workspace-name {
        max-width: 80px;
    }

    .groups-container {
        display: none;
        /* Maybe hide groups or make them scrollable differently? */
    }

    .right-section .icon-btn {
        padding: 4px;
    }

    .content {
        padding-top: 60px;
        /* Ensure space for header */
    }

    /* Hide some header buttons on mobile to save space */
    #sort-select,
    .sort-container {
        display: none;
    }

    /* Files View Responsive */
    .files-view-layout {
        flex-direction: column;
        gap: 20px !important;
        /* Override inline style */
    }

    .files-sidebar {
        width: 100% !important;
        display: flex !important;
        flex-direction: row !important;
        gap: 10px !important;
        margin-bottom: 5px;
    }

    .files-sidebar>div {
        flex: 1;
        min-width: 0;
    }

    /* Make file widgets more compact in row layout */
    .files-sidebar .dashboard-widget {
        padding: 10px !important;
        gap: 8px !important;
        min-height: auto !important;
    }

    .files-sidebar .drop-zone-mini {
        padding: 12px 5px !important;
        min-height: 80px !important;
    }

    .files-sidebar .drop-icon-svg {
        width: 24px !important;
        height: 24px !important;
    }

    .files-sidebar #drop-zone p {
        font-size: 0.7rem !important;
        margin: 0 !important;
    }


    .files-main-content {
        width: 100%;
    }

    #files-view {
        padding: 10px !important;
        width: 100% !important;
    }

    /* Chat View Responsive */
    #chat-view {
        flex-direction: column !important;
        width: 100% !important;
        height: calc(100vh - 70px) !important;
        /* Adjust height for mobile */
        padding: 10px !important;
        gap: 10px !important;
    }

    #chat-sidebar {
        width: 100% !important;
        height: 140px !important;
        /* Reduced height for sidebar on mobile */
        min-height: 140px;
        border-right: none !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 12px 12px 0 0 !important;
        padding: 10px !important;
        overflow-y: auto;
    }

    #chat-main {
        width: 100% !important;
        flex: 1;
        border-radius: 0 0 12px 12px;
    }

    /* Adjust chat input area for mobile */
    .chat-input-area {
        padding-bottom: 5px;
        /* Ensure input isn't too close to edge */
    }

    /* Indicators Responsive (Mobile) */
    #indicators-view .indicators-container {
        grid-template-columns: repeat(2, 1fr) !important;
        padding: 10px !important;
        gap: 10px !important;
    }

    #indicators-view .indicator-card {
        min-height: 100px !important;
        padding: 10px !important;
    }

    #indicators-view .indicator-card h3 {
        font-size: 0.8rem;
    }

    #indicators-view .indicator-value {
        font-size: 1rem;
    }

    /* Mobile Menu Styles */
    .mobile-menu-toggle {
        display: flex !important;
    }

    #add-tab-btn,
    #search-toggle-btn,
    #notes-btn,
    #todo-btn,
    #files-btn,
    #projects-btn,
    #chat-btn,
    #indicators-btn {
        display: none !important;
    }

    .mobile-menu-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.7);
        backdrop-filter: blur(15px);
        z-index: 2000;
        opacity: 0;
        pointer-events: none;
        transition: all 0.3s ease;
    }

    .mobile-menu-overlay.active {
        opacity: 1;
        pointer-events: all;
    }

    .mobile-menu-content {
        position: absolute;
        top: 0;
        right: -300px;
        width: 300px;
        height: 100%;
        background: rgba(20, 20, 20, 0.95);
        border-left: 1px solid rgba(255, 255, 255, 0.1);
        padding: 30px;
        transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
        display: flex;
        flex-direction: column;
        gap: 30px;
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
    }

    .mobile-menu-overlay.active .mobile-menu-content {
        right: 0;
    }

    .mobile-menu-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 20px;
    }

    .close-mobile-menu {
        background: transparent;
        border: none;
        color: white;
        font-size: 2rem;
        cursor: pointer;
        line-height: 1;
        opacity: 0.7;
    }

    .mobile-nav {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    .mobile-nav-item {
        background: rgba(255, 255, 255, 0.03);
        border: 1px solid rgba(255, 255, 255, 0.08);
        border-radius: 12px;
        color: white;
        padding: 14px 20px;
        display: flex;
        align-items: center;
        gap: 15px;
        font-size: 1rem;
        font-weight: 500;
        text-align: left;
        cursor: pointer;
        transition: all 0.2s ease;
    }

    .mobile-nav-item:active,
    .mobile-nav-item.active {
        background: rgba(59, 130, 246, 0.15);
        border-color: var(--accent-color);
        color: var(--accent-color);
    }

    .mobile-nav-item.active svg {
        opacity: 1;
    }

    .mobile-groups-container {
        display: flex;
        flex-direction: column;
        gap: 8px;
        margin-bottom: 5px;
    }

    .mobile-nav-item svg {
        width: 20px;
        height: 20px;
        color: var(--accent-color);
    }
}



/* Small Mobile (max-width: 480px) */
@media (max-width: 480px) {
    .shortcuts-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Base states for mobile menu */
.mobile-menu-toggle {
    display: none;
}

.mobile-menu-overlay {
    display: none;
}

@media (max-width: 768px) {
    .mobile-menu-overlay {
        display: block;
    }
}