/* ===============================
   MAIN.CSS - BASE & LAYOUT
   =============================== */

/* Reset et base */
* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
}

html { 
    -webkit-overflow-scrolling: touch; 
    height: 100%; 
    position: fixed; 
    width: 100%; 
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh; 
    height: 100vh; 
    font-size: 16px; 
    color: #333;
    overflow-x: hidden; 
    overflow-y: auto; 
    position: relative;
    -webkit-overflow-scrolling: touch; 
    transform: translate3d(0,0,0);
    width: 100%; 
    max-width: 100vw;
}

.app-container {
    background: #f8f9fa; 
    min-height: 100vh; 
    height: 100vh;
    overflow-y: auto; 
    overflow-x: hidden; 
    -webkit-overflow-scrolling: touch;
    width: 100%; 
    max-width: 100vw;
}

/* Icônes */
.icon { 
    width: 24px; 
    height: 24; 
    stroke: currentColor; 
    fill: none; 
    stroke-width: 2; 
    stroke-linecap: round; 
    stroke-linejoin: round; 
    flex-shrink: 0; 
}

.icon-sm { width: 16px; height: 16px; stroke-width: 2.5; }
.icon-md { width: 20px; height: 20px; }
.icon-lg { width: 28px; height: 28px; stroke-width: 1.5; }
.icon-xl { width: 32px; height: 32px; stroke-width: 1.5; }
.icon-success { color: #27ae60; }
.icon-error { color: #e74c3c; }
.icon-warning { color: #f39c12; }
.icon-primary { color: #667eea; }
.icon-muted { color: #666; }

.icon-container { 
    width: 44px; 
    height: 44px; 
    border-radius: 12px; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    margin-right: 14px; 
    flex-shrink: 0; 
    background: linear-gradient(135deg, #667eea, #764ba2); 
    color: white; 
}

/* États d'affichage */
.empty-state { 
    text-align: center; 
    padding: 60px 20px; 
    color: #666; 
}

.empty-state-icon { 
    margin-bottom: 16px; 
    opacity: 0.5; 
    display: flex; 
    justify-content: center; 
}

.empty-state-text { 
    font-size: 1.1rem; 
    font-weight: 600; 
    margin-bottom: 8px; 
}

.empty-state-subtext { 
    font-size: 0.9rem; 
    opacity: 0.8; 
}

.loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s ease-in-out infinite;
    margin-right: 8px;
}

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

/* Header */
.header { 
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); 
    color: white; 
    padding: max(16px, env(safe-area-inset-top) + 8px) 20px 12px; 
    border-radius: 0 0 20px 20px; 
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.25); 
    width: 100%; 
    max-width: 100vw; 
    word-wrap: break-word; 
    overflow-wrap: break-word; 
    position: relative;
}

.header-content {
    display: flex;
    align-items: center;
    gap: 16px;
    justify-content: flex-start;
}

.header-text {
    flex: 1;
    text-align: center;
}

.header h1 { 
    font-size: 1.5rem; 
    font-weight: 700; 
    margin-bottom: 4px; 
    white-space: nowrap; 
    overflow: hidden; 
    text-overflow: ellipsis; 
    max-width: 100%; 
}

.header p { 
    font-size: 0.85rem; 
    opacity: 0.8; 
}

/* Menu burger */
.burger-menu {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    width: 28px;
    height: 28px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0;
    backdrop-filter: blur(10px);
    opacity: 0.8;
}

.burger-menu:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.05);
}

.burger-menu:active {
    transform: scale(0.95);
}

.burger-menu span {
    width: 14px;
    height: 1.5px;
    background: white;
    border-radius: 1px;
    transition: all 0.3s ease;
    transform-origin: center;
}

.burger-menu.active span:nth-child(1) {
    transform: rotate(45deg) translate(3px, 3px);
}

.burger-menu.active span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.burger-menu.active span:nth-child(3) {
    transform: rotate(-45deg) translate(4px, -4px);
}

/* Menu burger simple */
.simple-burger-menu {
    position: absolute;
    top: 100%;
    left: 20px;
    background: white;
    border-radius: 12px;
    padding: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    z-index: 1000;
    display: none;
    min-width: 150px;
}

.simple-burger-menu.show {
    display: block;
}

.simple-menu-item {
    padding: 12px 16px;
    cursor: pointer;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    transition: background 0.2s;
}

.simple-menu-item:hover {
    background: #f0f0f0;
}

/* Navigation */
.nav { 
    position: fixed !important; 
    bottom: 0 !important; 
    left: 0 !important; 
    right: 0 !important; 
    background: rgba(255, 255, 255, 0.95); 
    backdrop-filter: blur(30px); 
    border-top: 1px solid rgba(102, 126, 234, 0.1); 
    z-index: 1000 !important; 
    padding: 20px 0 max(45px, env(safe-area-inset-bottom)); 
    box-shadow: 0 -4px 30px rgba(102, 126, 234, 0.15); 
    border-radius: 25px 25px 0 0; 
    border-top: 2px solid rgba(102, 126, 234, 0.1); 
}

.nav-tabs { 
    display: flex; 
    justify-content: space-around; 
    align-items: center; 
    padding: 0 15px; 
    max-width: 500px; 
    margin: 0 auto; 
}

.nav-tab { 
    flex: 1; 
    max-width: 80px; 
    padding: 10px 8px; 
    background: none; 
    border: none; 
    color: #8e8e93; 
    cursor: pointer; 
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); 
    text-align: center; 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    gap: 4px; 
    border-radius: 16px; 
    min-height: 55px; 
}

.nav-tab.active { 
    color: #667eea; 
    transform: scale(1.05); 
}

.nav-icon { 
    width: 28px; 
    height: 28px; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    transition: all 0.3s ease; 
    position: relative;
}

.nav-tab.active .nav-icon { 
    transform: translateY(-2px); 
}

.nav-icon svg { 
    width: 24px; 
    height: 24px; 
    stroke: currentColor; 
    fill: none; 
    stroke-width: 1.8; 
    stroke-linecap: round; 
    stroke-linejoin: round; 
}

.nav-tab.active .nav-icon svg { 
    stroke-width: 2.2; 
}

.nav-text { 
    font-size: 0.65rem; 
    font-weight: 600; 
    text-transform: uppercase; 
    letter-spacing: 0.3px; 
    white-space: nowrap; 
    overflow: hidden; 
    text-overflow: ellipsis; 
}

.nav-tab.active .nav-text { 
    font-weight: 700; 
    transform: translateY(-1px); 
}



/* Badge de notification */
.nav-badge { 
    position: absolute; 
    top: -2px; 
    right: -2px; 
    background: #e74c3c; 
    color: white; 
    border-radius: 50%; 
    min-width: 16px; 
    height: 16px; 
    font-size: 0.6rem; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    font-weight: 700; 
    box-shadow: 0 2px 4px rgba(231, 76, 60, 0.3); 
    border: 2px solid white; 
    opacity: 0; 
    transform: scale(0); 
    transition: all 0.3s ease; 
}

.nav-badge.show { 
    opacity: 1; 
    transform: scale(1); 
    animation: badgePulse 2s infinite; 
}

@keyframes badgePulse { 
    0% { transform: scale(1); } 
    50% { transform: scale(1.1); } 
    100% { transform: scale(1); } 
}

/* Layout principal */
.content { 
    padding: 16px 14px calc(145px + env(safe-area-inset-bottom)); 
    min-height: calc(100vh - 200px); 
    position: relative; 
    overflow: visible; 
    width: 100%; 
    max-width: 100vw; 
    word-wrap: break-word; 
    overflow-wrap: break-word; 
}

/* Pages */
.page { 
    width: 100%;
    position: relative;
    display: none;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
}