/* /assets/css/layout.css */

/* =========================================
   App Shell Layout
   ========================================= */
.app-layout {
    display: flex;
    min-height: 100vh;
    position: relative;
}

/* Sidebar (Desktop Only) */
.app-sidebar {
    display: none;
    /* Hidden on mobile by default */
    width: var(--sidebar-width);
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    border-right: 1px solid var(--kookly-border-color);
    background-color: var(--kookly-bg-card);
    z-index: var(--z-fixed);
    padding: var(--space-6) var(--space-4);
    overflow-y: auto;
    flex-direction: column;
}

.app-sidebar-logo {
    margin-bottom: var(--space-8);
    padding: 0 var(--space-2);
}

.app-sidebar-logo img {
    height: 40px;
    width: auto;
}

.app-sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: 12px 16px;
    border-radius: var(--radius-lg);
    color: var(--kookly-text-body);
    font-weight: 500;
    font-family: var(--font-heading);
    transition: all var(--transition-fast);
    text-decoration: none;
}

.nav-item i {
    font-size: 1.25rem;
    color: var(--kookly-text-muted);
    transition: color var(--transition-fast);
}

.nav-item:hover {
    background-color: var(--kookly-bg-hover);
    color: var(--kookly-text-heading);
}

.nav-item:hover i {
    color: var(--kookly-text-heading);
}

.nav-item.active {
    background-color: var(--kookly-primary-light);
    color: var(--kookly-primary);
    font-weight: 600;
}

.nav-item.active i {
    color: var(--kookly-primary);
}

/* Main Content Area */
.main-content {
    flex: 1;
    width: 100%;
    padding-bottom: calc(var(--bottom-nav-height) + var(--space-4));
    /* Mobile nav safe area */
}

/* Desktop Grid Layout */
@media (min-width: 992px) {
    .app-sidebar {
        display: flex;
    }

    .main-content {
        margin-left: var(--sidebar-width);
        padding-bottom: var(--space-8);
        display: block;
        /* Changed from flex to block to avoid width issues, or use flex-direction column if needed */
        width: auto;
        /* Fix scrolling */
        min-width: 0;
        /* Enable shrinking */
    }

    .page-container {
        width: 100%;
        max-width: 1200px;
        /* Increased max width */
        margin: 0 auto;
        padding: var(--space-8);
    }

    /* Two column layout inside main content for feed + widgets */
    .content-grid {
        display: grid;
        grid-template-columns: 1fr 320px;
        gap: var(--space-8);
        align-items: start;
    }

    .content-feed {
        min-width: 0;
        /* Fix grid overflow */
    }

    /* Widgets side */
    .content-widgets {
        position: sticky;
        top: var(--space-6);
        display: flex;
        flex-direction: column;
        gap: var(--space-6);
    }
}

/* =========================================
   Bottom Navigation (Mobile Only)
   ========================================= */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--bottom-nav-height);
    background-color: var(--kookly-bg-card);
    border-top: 1px solid var(--kookly-border-color);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: var(--z-fixed);
    padding: 0 var(--space-2);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.03);
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: var(--kookly-text-muted);
    font-size: 0.75rem;
    font-weight: 600;
    text-decoration: none;
    width: 64px;
    height: 100%;
}

.bottom-nav-item i {
    font-size: 1.5rem;
    margin-bottom: 2px;
    transition: transform var(--transition-fast);
}

.bottom-nav-item.active {
    color: var(--kookly-primary);
}

.bottom-nav-item.active i {
    transform: translateY(-2px);
}

/* Special FAB in Bottom Nav */
.bottom-nav-fab {
    width: 48px;
    height: 48px;
    background-color: var(--kookly-primary);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    box-shadow: var(--shadow-primary);
    transform: translateY(-12px);
    transition: transform var(--transition-fast);
}

.bottom-nav-fab i {
    font-size: 1.75rem;
    color: #fff;
}

.bottom-nav-fab:active {
    transform: translateY(-8px);
}

@media (min-width: 992px) {
    .bottom-nav {
        display: none;
    }
}