/**
 * SENTINEL-X - Layout Base Unifié v1.0.0
 * Styles de base partagés par TOUTES les pages
 * Remplace les duplications CSS entre pages
 * MCA INFO - 23/02/2026
 */

/* === RESET & BASE === */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --primary: #00d4aa;
    --primary-dark: #00b894;
    --primary-light: #00e6b8;
    --secondary: #0a1628;
    --bg-dark: #0a1628;
    --bg-card: #1a2a4a;
    --bg-card-hover: #1e3050;
    --bg-input: #0d1f38;
    --text: #ffffff;
    --text-muted: #8899aa;
    --text-dim: #667788;
    --border: rgba(0, 212, 170, 0.2);
    --border-light: rgba(255, 255, 255, 0.1);
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    --shadow-primary: 0 10px 30px rgba(0, 212, 170, 0.3);
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --transition: all 0.3s ease;
    --font-main: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --header-height: 60px;
}

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-main);
    background: var(--bg-dark);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* === LAYOUT === */
.page-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

.container-sm { max-width: 800px; margin: 0 auto; padding: 0 20px; }
.container-xs { max-width: 600px; margin: 0 auto; padding: 0 20px; }

main, .main-content {
    flex: 1;
    padding-top: calc(var(--header-height) + 30px);
    padding-bottom: 40px;
}

/* === CARDS === */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 25px;
    border: 1px solid var(--border);
    transition: var(--transition);
}

.card:hover {
    background: var(--bg-card-hover);
    
    box-shadow: var(--shadow);
}

.card-header { margin-bottom: 20px; padding-bottom: 15px; border-bottom: 1px solid var(--border-light); }
.card-title { font-size: 18px; font-weight: 600; color: var(--text); }
.card-subtitle { font-size: 14px; color: var(--text-muted); margin-top: 5px; }

/* === BOUTONS === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 30px;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.btn-primary { background: var(--primary); color: var(--secondary); }
.btn-primary:hover { background: var(--primary-light);  box-shadow: var(--shadow-primary); }

.btn-secondary { background: transparent; color: var(--primary); border: 2px solid var(--primary); }
.btn-secondary:hover { background: rgba(0, 212, 170, 0.1);  }

.btn-danger { background: #e74c3c; color: white; }
.btn-danger:hover { background: #c0392b;  }

.btn-sm { padding: 8px 16px; font-size: 12px; }
.btn-lg { padding: 16px 32px; font-size: 16px; }
.btn-block { width: 100%; }

.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }

/* === FORMULAIRES === */
.form-group { margin-bottom: 20px; }
.form-label { display: block; font-size: 14px; color: var(--text-muted); margin-bottom: 8px; font-weight: 500; }

.form-control {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 14px;
    transition: var(--transition);
}

.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(0, 212, 170, 0.15); }
.form-control::placeholder { color: var(--text-dim); }

select.form-control { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2300d4aa' d='M6 8L1 3h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }

/* === ALERTES / TOASTS === */
.alert { padding: 16px 20px; border-radius: var(--radius); margin-bottom: 20px; font-size: 14px; }
.alert-success { background: rgba(0, 212, 170, 0.15); border: 1px solid var(--primary); color: var(--primary); }
.alert-error { background: rgba(231, 76, 60, 0.15); border: 1px solid #e74c3c; color: #e74c3c; }
.alert-warning { background: rgba(241, 196, 15, 0.15); border: 1px solid #f1c40f; color: #f1c40f; }
.alert-info { background: rgba(52, 152, 219, 0.15); border: 1px solid #3498db; color: #3498db; }

/* === TABLES === */
.table-responsive { overflow-x: auto; border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; }
th { background: rgba(0, 212, 170, 0.1); color: var(--primary); font-weight: 600; text-align: left; padding: 12px 16px; font-size: 0.8125rem; }
td { padding: 12px 16px; border-bottom: 1px solid var(--border-light); font-size: 14px; color: var(--text-muted); }
tr:hover td { background: rgba(0, 212, 170, 0.03); }

/* === BADGES / TAGS === */
.badge { display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; text-transform: uppercase; }
.badge-success { background: rgba(0, 212, 170, 0.2); color: var(--primary); }
.badge-danger { background: rgba(231, 76, 60, 0.2); color: #e74c3c; }
.badge-warning { background: rgba(241, 196, 15, 0.2); color: #f1c40f; }
.badge-info { background: rgba(52, 152, 219, 0.2); color: #3498db; }

/* === UTILITAIRES === */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-primary { color: var(--primary); }
.text-danger { color: #e74c3c; }
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; } .mt-4 { margin-top: 32px; }
.mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; } .mb-4 { margin-bottom: 32px; }
.p-1 { padding: 8px; } .p-2 { padding: 16px; } .p-3 { padding: 24px; } .p-4 { padding: 32px; }
.d-flex { display: flex; } .d-grid { display: grid; }
.gap-1 { gap: 8px; } .gap-2 { gap: 16px; } .gap-3 { gap: 24px; }
.justify-between { justify-content: space-between; }
.align-center { align-items: center; }
.flex-wrap { flex-wrap: wrap; }
.hidden { display: none !important; }

/* === LOADER === */
.spinner { width: 32px; height: 32px; border: 3px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .container { padding: 0 15px; }
    .card { padding: 20px; }
    .btn { padding: 10px 20px; font-size: 0.8125rem; }
    .d-flex { flex-direction: column; }
    main, .main-content { padding-top: calc(var(--header-height) + 20px); }
}

@media (max-width: 480px) {
    .card { padding: 15px; border-radius: var(--radius); }
    .btn-lg { padding: 12px 24px; font-size: 14px; }
    h1 { font-size: 24px; }
    h2 { font-size: 20px; }
}

/* === SCROLLBAR === */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-dark); }
::-webkit-scrollbar-thumb { background: var(--bg-card); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* === ANIMATIONS === */
.fade-in { animation: fadeIn 0.3s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.slide-up { animation: slideUp 0.4s ease; }
@keyframes slideUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }
