/* ============================================================================
   LAYOUT - Alnaql
   ============================================================================
   
   Core application layout structure with fixed navigation and footer.
   
   Layout Architecture:
   - Fixed navigation bar at top (60px)
   - Fixed footer at bottom (70px)
   - Scrollable main content area in between
   - App controls its own scroll regions
   
   Note: This file consolidates duplicate layout rules from the original
   style.css (lines 16-148 and 188-197).
   
   ============================================================================ */

/* ========================================================================
   App Container
   ======================================================================== */

.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100%;
}


/* ========================================================================
   Main Content Area
   ======================================================================== */

.app-main {
    /* Account for fixed nav (60px) and footer (70px) */
    margin-top: var(--nav-height);
    margin-bottom: var(--footer-height);
    height: calc(100vh - var(--nav-height) - var(--footer-height));

    /* This area is scrollable */
    overflow-y: auto;
    overflow-x: hidden;

    /* Flex for alternative layouts */
    flex: 1;
}

/* Pages without a fixed footer reclaim the reserved space */
.app-main.no-footer {
    margin-bottom: 0;
    height: calc(100vh - var(--nav-height));
}

/* Ensure child components don't have conflicting positioning */
.app-main > * {
    position: relative;
}


/* ========================================================================
   Container Widths
   ======================================================================== */

/* Standard content container */
.container {
    width: 100%;
    max-width: var(--content-max-width);
    margin: 0 auto;
    padding: 0 var(--space-5);
}

/* Medium width container */
.container-medium {
    width: 100%;
    max-width: var(--content-max-width-medium);
    margin: 0 auto;
    padding: 0 var(--space-5);
}

/* Narrow container for focused content */
.container-narrow {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    padding: 0 var(--space-5);
}

/* Full width container */
.container-fluid {
    width: 100%;
    padding: 0 var(--space-5);
}


/* ========================================================================
   Flexbox Utilities
   ======================================================================== */

.flex {
    display: flex;
}

.flex-column {
    display: flex;
    flex-direction: column;
}

.flex-row {
    display: flex;
    flex-direction: row;
}

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.flex-start {
    display: flex;
    justify-content: flex-start;
    align-items: center;
}

.flex-end {
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.flex-wrap {
    flex-wrap: wrap;
}

.flex-1 {
    flex: 1;
}

.flex-shrink-0 {
    flex-shrink: 0;
}


/* ========================================================================
   Grid Utilities
   ======================================================================== */

.grid {
    display: grid;
}

.grid-cols-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-5);
}

.grid-cols-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-5);
}

.grid-cols-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-5);
}

/* Auto-fill grid that adapts to content */
.grid-auto-fill {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--space-5);
}


/* ========================================================================
   Spacing Utilities
   ======================================================================== */

/* Padding */
.p-0 { padding: 0; }
.p-2 { padding: var(--space-2); }
.p-4 { padding: var(--space-4); }
.p-5 { padding: var(--space-5); }
.p-6 { padding: var(--space-6); }
.p-8 { padding: var(--space-8); }

/* Margin */
.m-0 { margin: 0; }
.m-auto { margin: 0 auto; }
.mt-4 { margin-top: var(--space-4); }
.mt-5 { margin-top: var(--space-5); }
.mt-8 { margin-top: var(--space-8); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-5 { margin-bottom: var(--space-5); }
.mb-8 { margin-bottom: var(--space-8); }

/* Gap utilities for flex/grid */
.gap-2 { gap: var(--space-2); }
.gap-4 { gap: var(--space-4); }
.gap-5 { gap: var(--space-5); }
.gap-6 { gap: var(--space-6); }


/* ========================================================================
   Display Utilities
   ======================================================================== */

.hidden {
    display: none;
}

.block {
    display: block;
}

.inline {
    display: inline;
}

.inline-block {
    display: inline-block;
}


/* ========================================================================
   Positioning Utilities
   ======================================================================== */

.relative {
    position: relative;
}

.absolute {
    position: absolute;
}

.fixed {
    position: fixed;
}

.sticky {
    position: sticky;
}


/* ========================================================================
   Width & Height Utilities
   ======================================================================== */

.w-full {
    width: 100%;
}

.h-full {
    height: 100%;
}

.w-auto {
    width: auto;
}

.h-auto {
    height: auto;
}