/* Variables globales */
:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --success-color: #2ecc71;
    --danger-color: #e74c3c;
    --warning-color: #f1c40f;
    --info-color: #3498db;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --gray-color: #6c757d;
    --border-color: #dee2e6;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --transition-speed: 0.3s;
}

/* Reset et styles de base */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

html {
    font-size: 16px;
    height: 100%;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
    line-height: 1.5;
    color: var(--dark-color);
    background-color: var(--light-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

main {
    flex: 1 0 auto;
}

/* Navigation */
.navbar {
    background-color: var(--primary-color);
    box-shadow: 0 2px 4px var(--shadow-color);
    padding: 0.5rem 1rem;
}

.navbar-brand {
    color: white !important;
    font-weight: 600;
    display: flex;
    align-items: center;
}

.navbar-brand img {
    height: 40px;
    margin-right: 10px;
    -webkit-transform: translate3d(0,0,0);
    transform: translate3d(0,0,0);
}

.nav-link {
    color: rgba(255,255,255,0.8) !important;
    transition: color var(--transition-speed) ease;
    padding: 0.5rem 1rem;
}

.nav-link:hover, .nav-link.active {
    color: white !important;
}

/* Cards */
.card {
    border: none;
    border-radius: 10px;
    box-shadow: 0 4px 6px var(--shadow-color);
    margin-bottom: 1.5rem;
    background: white;
    -webkit-transform: translate3d(0,0,0);
    transform: translate3d(0,0,0);
}

.card-header {
    background-color: white;
    border-bottom: 1px solid var(--border-color);
    padding: 1rem;
}

.card-body {
    padding: 1.5rem;
}

/* Tables */
.table {
    margin-bottom: 0;
}

.table th {
    background-color: var(--primary-color);
    color: white;
    font-weight: 500;
    border: none;
    padding: 0.75rem;
}

.table td {
    padding: 0.75rem;
    vertical-align: middle;
}

.table-hover tbody tr:hover {
    background-color: rgba(52, 152, 219, 0.1);
}

/* Forms */
.form-control {
    border-radius: 8px;
    border: 1px solid var(--border-color);
    padding: 0.75rem 1rem;
    font-size: 1rem;
    transition: all var(--transition-speed) ease;
}

.form-control:focus {
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 0.2rem rgba(52, 152, 219, 0.25);
    outline: none;
}

.form-label {
    font-weight: 500;
    margin-bottom: 0.5rem;
}

/* Buttons */
.btn {
    border-radius: 8px;
    padding: 0.75rem 1.5rem;
    font-weight: 500;
    transition: all var(--transition-speed) ease;
    -webkit-transform: translate3d(0,0,0);
    transform: translate3d(0,0,0);
}

.btn-primary {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
}

.btn-primary:hover {
    background-color: #2980b9;
    border-color: #2980b9;
    transform: translateY(-1px);
}

/* Alerts */
.alert {
    border: none;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.alert-success {
    background-color: var(--success-color);
    color: white;
}

.alert-danger {
    background-color: var(--danger-color);
    color: white;
}

/* Footer */
footer {
    background-color: var(--dark-color);
    color: white;
    padding: 1rem 0;
    margin-top: auto;
}

/* Icons */
.fas, .far, .fab {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Badges */
.badge {
    padding: 0.5em 0.75em;
    font-weight: 500;
    border-radius: 6px;
}

/* Modals */
.modal-content {
    border-radius: 10px;
    border: none;
}

.modal-header {
    background-color: var(--primary-color);
    color: white;
    border-radius: 10px 10px 0 0;
    padding: 1rem;
}

.modal-title {
    font-weight: 600;
}

/* Lists */
.list-group-item {
    border: none;
    padding: 1rem;
    margin-bottom: 0.5rem;
    border-radius: 8px !important;
}

/* Pagination */
.pagination {
    margin-bottom: 0;
}

.page-link {
    color: var(--secondary-color);
    border: none;
    padding: 0.5rem 1rem;
    margin: 0 0.25rem;
    border-radius: 6px;
}

.page-item.active .page-link {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
}

/* Spinners */
.spinner-border {
    width: 2rem;
    height: 2rem;
    border-width: 0.25rem;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .card {
        margin-bottom: 1rem;
    }

    .table-responsive {
        margin-bottom: 1rem;
    }
}

/* Cross-browser compatibility */
input[type="email"],
input[type="password"],
input[type="text"],
input[type="number"],
input[type="date"],
input[type="time"],
input[type="datetime-local"],
input[type="month"],
input[type="week"],
input[type="url"],
input[type="tel"],
input[type="search"],
input[type="file"],
select,
textarea {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

/* Touch devices */
@media (hover: none) {
    .btn:hover {
        transform: none;
    }
}

/* Print styles */
@media print {
    .navbar,
    .btn,
    .no-print {
        display: none !important;
    }

    body {
        background: none;
    }

    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }

    .table th {
        background-color: #f8f9fa !important;
        color: #000 !important;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    :root {
        --primary-color: #34495e;
        --secondary-color: #2980b9;
        --light-color: #2c3e50;
        --dark-color: #ecf0f1;
        --border-color: #34495e;
        --shadow-color: rgba(0, 0, 0, 0.3);
    }

    body {
        background-color: var(--light-color);
        color: var(--dark-color);
    }

    .card {
        background-color: #34495e;
    }

    .form-control {
        background-color: #2c3e50;
        border-color: var(--border-color);
        color: var(--dark-color);
    }

    .table {
        color: var(--dark-color);
    }

    .table td {
        border-color: var(--border-color);
    }

    .modal-content {
        background-color: #34495e;
        color: var(--dark-color);
    }
}

/* High DPI screens */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    body {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}

/* iOS specific fixes */
@supports (-webkit-touch-callout: none) {
    .form-control,
    .btn {
        font-size: 16px; /* Prevent zoom on focus */
    }
}

/* Firefox specific fixes */
@-moz-document url-prefix() {
    .form-control {
        text-indent: -2px;
    }
}

/* Stats cards */
.stat-card {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: #fff;
    padding: 1.5rem;
    border-radius: 10px;
    margin-bottom: 1rem;
    -webkit-transform: translate3d(0,0,0);
    transform: translate3d(0,0,0);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease-in-out;
    -webkit-animation: fadeIn 0.3s ease-in-out;
}

/* Accessibility */
.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0,0,0,0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
}

/* Utilities */
.text-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cursor-pointer {
    cursor: pointer;
}

.user-select-none {
    user-select: none;
    -webkit-user-select: none;
}

/* Charts */
.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
    -webkit-transform: translate3d(0,0,0);
    transform: translate3d(0,0,0);
}

/* Styles des icônes */
.fa, .fas, .far, .fab {
    margin-right: 0.5rem;
}

/* Styles des listes */
.list-group-item {
    padding: 1rem;
}

/* Styles des pagination */
.pagination {
    margin-bottom: 0;
}

/* Styles des spinners */
.spinner-border {
    width: 3rem;
    height: 3rem;
} 