/**
 * LAYOUT CSS
 * ==========
 * Structure de l'application.
 * Header, Main, Footer.
 * Mobile-first.
 */

/* ===================
   APP SHELL
   =================== */

.app-shell {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ===================
   HEADER
   =================== */

.app-header {
    position: sticky;
    top: 0;
    z-index: var(--z-sticky);
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-height);
    padding: 0 var(--space-4);
    background-color: var(--color-white);
    border-bottom: var(--border-width) solid var(--color-border);
    box-shadow: var(--shadow-sm);
}

.header-brand {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.brand-logo {
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-bold);
    color: var(--color-primary);
}

.brand-tagline {
    display: none;
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
}

/* Afficher tagline sur écrans plus grands */
@media (min-width: 640px) {
    .brand-tagline {
        display: inline;
    }
}

.header-user {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.user-name {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    color: var(--color-text);
}

.icon-logout {
    font-size: var(--font-size-lg);
    color: var(--color-gray-500);
}

/* ===================
   MAIN
   =================== */

.app-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: var(--space-4);
}

/* Centrer le contenu sur grands écrans */
@media (min-width: 1024px) {
    .app-main {
        padding: var(--space-6);
    }
}

/* ===================
   FOOTER
   =================== */

.app-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    height: var(--footer-height);
    padding: 0 var(--space-4);
    background-color: var(--color-white);
    border-top: var(--border-width) solid var(--color-border);
}

.footer-text {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
}

/* ===================
   LOADER OVERLAY
   =================== */

.loader-overlay {
    position: fixed;
    inset: 0;
    z-index: var(--z-loader);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-4);
    background-color: var(--color-white);
}

.loader-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--color-gray-200);
    border-top-color: var(--color-primary);
    border-radius: var(--radius-full);
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loader-text {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
}

/* ===================
   SCREENS (PAGES)
   =================== */

.screen {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* ===================
   CONTENEURS
   =================== */

.container {
    width: 100%;
    max-width: var(--max-width-lg);
    margin: 0 auto;
    padding: 0 var(--space-4);
}

.container-sm {
    max-width: var(--max-width-sm);
}

.container-md {
    max-width: var(--max-width-md);
}
