/**
 * Moving Systems Dashboard - Layout Styles
 * 
 * Pagina structuur: header, sidebar, main content
 */

/* =========================================================
   RESET & BASE
   ========================================================= */

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-body);
    font-size: var(--text-base);
    line-height: var(--leading-normal);
    color: var(--color-black);
    background-color: var(--color-off-white);
    min-height: 100vh;
}

/* =========================================================
   TYPOGRAPHY BASE
   ========================================================= */

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: var(--font-bold);
    line-height: var(--leading-tight);
    color: var(--color-black);
}

h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }
h6 { font-size: var(--text-base); }

p {
    margin-bottom: var(--space-md);
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--color-primary-light);
}

/* =========================================================
   APP LAYOUT
   ========================================================= */

.app-layout {
    display: flex;
    min-height: 100vh;
}

/* =========================================================
   SIDEBAR
   ========================================================= */

.sidebar {
    width: var(--sidebar-width);
    background: var(--color-primary);
    color: var(--color-white);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: var(--z-fixed);
    transition: transform var(--transition-base);
}

.sidebar-header {
    padding: var(--space-lg);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-logo {
    font-family: var(--font-heading);
    font-size: var(--text-xl);
    font-weight: var(--font-bold);
    color: var(--color-white);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.sidebar-logo:hover {
    color: var(--color-white);
}

.sidebar-nav {
    flex: 1;
    padding: var(--space-md) 0;
    overflow-y: auto;
}

.sidebar-nav-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-lg);
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    transition: all var(--transition-fast);
    border-left: 3px solid transparent;
}

.sidebar-nav-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--color-white);
}

.sidebar-nav-item.active {
    background: rgba(255, 255, 255, 0.15);
    color: var(--color-white);
    border-left-color: var(--color-white);
}

.sidebar-nav-item svg,
.sidebar-nav-item .icon {
    width: 20px;
    height: 20px;
    opacity: 0.8;
}

.sidebar-nav-item.active svg,
.sidebar-nav-item.active .icon {
    opacity: 1;
}

/* Sidebar Submenu */
.sidebar-submenu {
    padding-left: var(--space-xl);
}

.sidebar-submenu .sidebar-nav-item {
    padding: var(--space-xs) var(--space-lg);
    font-size: var(--text-sm);
    border-left: none;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: var(--space-md) var(--space-lg);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

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

.sidebar-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: var(--font-bold);
    font-size: var(--text-sm);
}

.sidebar-user-info {
    flex: 1;
    min-width: 0;
}

.sidebar-user-name {
    font-weight: var(--font-medium);
    font-size: var(--text-sm);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-role {
    font-size: var(--text-xs);
    opacity: 0.7;
}

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

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.main-header {
    background: var(--color-white);
    border-bottom: 1px solid var(--color-gray-light);
    padding: 0 var(--space-lg);
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: var(--z-sticky);
}

.main-header-title {
    font-family: var(--font-heading);
    font-size: var(--text-xl);
    font-weight: var(--font-semibold);
    color: var(--color-primary);
}

.main-header-actions {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

/* Page Content */
.page-content {
    flex: 1;
    padding: var(--space-lg);
}

/* Page Header */
.page-header {
    margin-bottom: var(--space-lg);
}

.page-title {
    font-size: var(--text-2xl);
    color: var(--color-primary);
    margin-bottom: var(--space-xs);
}

.page-subtitle {
    color: var(--color-gray);
    font-size: var(--text-base);
}

/* =========================================================
   CONTENT SECTIONS
   ========================================================= */

.section {
    margin-bottom: var(--space-xl);
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-md);
}

.section-title {
    font-size: var(--text-lg);
    font-weight: var(--font-semibold);
    color: var(--color-black);
}

/* =========================================================
   GRID SYSTEM
   ========================================================= */

.grid {
    display: grid;
    gap: var(--space-lg);
}

.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 1200px) {
    .grid-cols-4 { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 992px) {
    .grid-cols-3,
    .grid-cols-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .grid-cols-2,
    .grid-cols-3,
    .grid-cols-4 { grid-template-columns: 1fr; }
    
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
}

/* =========================================================
   FLEX UTILITIES
   ========================================================= */

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.gap-xs { gap: var(--space-xs); }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }
.flex-1 { flex: 1; }
.flex-wrap { flex-wrap: wrap; }

/* =========================================================
   SPACING UTILITIES
   ========================================================= */

.mt-xs { margin-top: var(--space-xs); }
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }

.mb-xs { margin-bottom: var(--space-xs); }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }

.p-sm { padding: var(--space-sm); }
.p-md { padding: var(--space-md); }
.p-lg { padding: var(--space-lg); }
.p-xl { padding: var(--space-xl); }

/* =========================================================
   TEXT UTILITIES
   ========================================================= */

.text-xs { font-size: var(--text-xs); }
.text-sm { font-size: var(--text-sm); }
.text-base { font-size: var(--text-base); }
.text-lg { font-size: var(--text-lg); }
.text-xl { font-size: var(--text-xl); }

.text-primary { color: var(--color-primary); }
.text-success { color: var(--color-success); }
.text-warning { color: var(--color-warning); }
.text-danger { color: var(--color-danger); }
.text-gray { color: var(--color-gray); }
.text-muted { color: var(--color-gray); }

.font-medium { font-weight: var(--font-medium); }
.font-semibold { font-weight: var(--font-semibold); }
.font-bold { font-weight: var(--font-bold); }

.text-center { text-align: center; }
.text-right { text-align: right; }

/* =========================================================
   VISIBILITY
   ========================================================= */

.hidden { display: none !important; }
.visible { visibility: visible; }
.invisible { visibility: hidden; }

@media (max-width: 768px) {
    .hidden-mobile { display: none !important; }
}

@media (min-width: 769px) {
    .hidden-desktop { display: none !important; }
}
