/* ===== GLOBAL STYLES ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #0066cc;
    --secondary-color: #004999;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --sidebar-bg: #1e2a3a;
    --sidebar-hover: #2c3e50;
    --navbar-bg: #ffffff;
    --text-primary: #333333;
    --text-secondary: #666666;
    --border-color: #e0e0e0;
    --shadow: 0 2px 10px rgba(0,0,0,0.1);
    --shadow-lg: 0 4px 20px rgba(0,0,0,0.15);
}

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--text-primary);
    overflow-x: hidden;
}

/* ===== SPLASH SCREEN STYLES ===== */
.splash-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.splash-container {
    width: 100%;
    max-width: 500px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.splash-content {
    text-align: center;
    animation: fadeInUp 1s ease-in-out;
}

.logo-container {
    animation: bounceIn 1.5s ease-in-out;
}

.logo-circle {
    width: 120px;
    height: 120px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    animation: pulse 2s infinite;
}

.logo-circle i {
    font-size: 4rem;
    color: var(--primary-color);
}

.brand-name {
    font-size: 3rem;
    font-weight: 700;
    color: white;
    letter-spacing: 2px;
    margin: 0;
}

.brand-subtitle {
    font-size: 1.2rem;
    color: rgba(255,255,255,0.9);
    font-weight: 300;
    letter-spacing: 3px;
    margin: 0;
}

.welcome-message {
    margin-top: 2rem;
}

.welcome-title {
    font-size: 2rem;
    color: white;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.welcome-subtitle {
    font-size: 1rem;
    color: rgba(255,255,255,0.8);
    font-weight: 300;
}

.spinner-container {
    margin-top: 2rem;
}

.spinner-border {
    width: 3rem;
    height: 3rem;
    border-width: 0.3rem;
    color: white !important;
}

.splash-footer {
    margin-top: auto;
    padding-top: 2rem;
}

.splash-footer .copyright {
    color: rgba(255,255,255,0.7);
    font-size: 0.9rem;
}

/* ===== LOGIN PAGE STYLES ===== */
.login-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-container {
    padding: 2rem 0;
}

.login-card {
    background: white;
    border-radius: 20px;
    padding: 3rem;
    box-shadow: var(--shadow-lg);
    animation: fadeInUp 0.8s ease-in-out;
}

.login-header {
    margin-bottom: 2rem;
}

.logo-circle-small {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

.logo-circle-small i {
    font-size: 2.5rem;
    color: white;
}

.brand-name-login {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-top: 1rem;
}

.brand-subtitle-login {
    font-size: 1rem;
    color: var(--text-secondary);
    font-weight: 300;
    letter-spacing: 2px;
}

.login-title {
    font-size: 1.5rem;
    color: var(--text-primary);
    font-weight: 600;
}

.login-subtitle {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.login-form .form-label {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.login-form .input-group-text {
    background: var(--light-color);
    border: 1px solid var(--border-color);
    color: var(--primary-color);
}

.login-form .form-control {
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.95rem;
}

.login-form .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0,102,204,0.15);
}

.login-form .input-group .form-control {
    border-radius: 0 8px 8px 0;
}

.login-form .input-group-text {
    border-radius: 8px 0 0 8px;
}

.btn-login {
    padding: 0.85rem 2rem;
    font-size: 1.05rem;
    font-weight: 600;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border: none;
    transition: all 0.3s ease;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,102,204,0.3);
}

.forgot-link {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.9rem;
}

.forgot-link:hover {
    text-decoration: underline;
}

.help-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.help-text a {
    color: var(--primary-color);
    text-decoration: none;
}

.help-text a:hover {
    text-decoration: underline;
}

.copyright-login {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.8);
}

/* ===== DASHBOARD STYLES ===== */
.dashboard-page {
    background: var(--light-color);
}

/* Sidebar Styles */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 260px;
    height: 100vh;
    background: var(--sidebar-bg);
    color: white;
    transition: all 0.3s ease;
    z-index: 1000;
    overflow-y: auto;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
}

.sidebar.collapsed {
    width: 80px;
}

.sidebar-header {
    padding: 2rem 1rem;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.logo-sidebar {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
}

.logo-sidebar i {
    font-size: 2rem;
    color: white;
}

.sidebar-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    transition: opacity 0.3s;
}

.sidebar-subtitle {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.7);
    margin: 0;
    letter-spacing: 2px;
    transition: opacity 0.3s;
}

.sidebar.collapsed .sidebar-title,
.sidebar.collapsed .sidebar-subtitle {
    opacity: 0;
}

.sidebar-menu {
    list-style: none;
    padding: 1rem 0;
}

.menu-item {
    margin: 0.3rem 0;
}

.menu-item a {
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
}

.menu-item a:hover {
    background: var(--sidebar-hover);
    color: white;
}

.menu-item.active > a {
    background: var(--primary-color);
    color: white;
    border-left: 4px solid white;
}

.menu-item i {
    font-size: 1.2rem;
    width: 30px;
}

.menu-item span {
    margin-left: 1rem;
    transition: opacity 0.3s;
}

.sidebar.collapsed .menu-item span {
    opacity: 0;
    display: none;
}

/* Submenu Styles */
.menu-item.has-submenu > a {
    justify-content: space-between;
}

.submenu-arrow {
    font-size: 0.8rem;
    transition: transform 0.3s ease;
    margin-left: auto;
    width: auto !important;
}

.menu-item.has-submenu.open .submenu-arrow {
    transform: rotate(180deg);
}

.submenu {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: rgba(0,0,0,0.2);
}

.menu-item.has-submenu.open .submenu {
    max-height: 500px;
}

.submenu li a {
    padding: 0.75rem 1.5rem 0.75rem 3rem;
    font-size: 0.9rem;
}

.submenu li a i {
    font-size: 1rem;
    width: 25px;
}

.sidebar.collapsed .submenu {
    display: none;
}

/* Content Sections */
.content-section {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}

.content-section.active {
    display: block;
}

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

/* Employee Photo Preview */
.photo-preview {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
}

/* Fiche Employe Cards */
.fiche-card {
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 1rem;
    background: white;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

.fiche-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-3px);
}

.fiche-card .employee-photo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--primary-color);
}

.fiche-info {
    font-size: 0.9rem;
    line-height: 1.8;
}

.fiche-info strong {
    color: var(--primary-color);
}

/* Print Styles */
@media print {
    .sidebar,
    .top-navbar,
    .dashboard-footer,
    .btn,
    .modal-header,
    .modal-footer {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0 !important;
    }
    
    #printContent {
        padding: 2rem;
    }
}

.sidebar-footer {
    position: absolute;
    bottom: 0;
    width: 100%;
    padding: 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.logout-btn {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(220,53,69,0.1);
    color: #ff6b6b;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.logout-btn:hover {
    background: rgba(220,53,69,0.2);
    color: #ff4757;
}

.logout-btn i {
    font-size: 1.2rem;
    width: 30px;
}

.logout-btn span {
    margin-left: 1rem;
}

/* Main Content Styles */
.main-content {
    margin-left: 260px;
    min-height: 100vh;
    transition: margin-left 0.3s ease;
    display: flex;
    flex-direction: column;
}

.main-content.expanded {
    margin-left: 80px;
}

.top-navbar {
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    padding: 1rem 2rem;
    position: sticky;
    top: 0;
    z-index: 999;
}

.sidebar-toggle {
    font-size: 1.5rem;
    color: var(--text-primary);
    border: none;
    padding: 0.5rem;
}

.sidebar-toggle:hover {
    color: var(--primary-color);
}

.user-avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.nav-link {
    color: var(--text-primary);
    font-weight: 500;
}

.nav-link:hover {
    color: var(--primary-color);
}

/* Dashboard Content */
.dashboard-content {
    flex: 1;
    padding: 2rem;
}

.stats-card {
    background: white;
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 1.5rem;
    transition: all 0.3s ease;
}

.stats-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.stats-icon {
    width: 70px;
    height: 70px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
}

.stats-icon.bg-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
}

.stats-icon.bg-success {
    background: linear-gradient(135deg, #28a745, #20c997);
}

.stats-icon.bg-warning {
    background: linear-gradient(135deg, #ffc107, #ff9800);
}

.stats-icon.bg-danger {
    background: linear-gradient(135deg, #dc3545, #c82333);
}

.stats-info {
    flex: 1;
}

.stats-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.stats-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.stats-change {
    font-size: 0.85rem;
    margin: 0.25rem 0 0;
}

.dashboard-card {
    background: white;
    border: none;
    border-radius: 15px;
    box-shadow: var(--shadow);
}

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

.dashboard-card .card-body {
    padding: 1.5rem;
}

.table {
    margin: 0;
}

.table thead th {
    border-bottom: 2px solid var(--border-color);
    color: var(--text-primary);
    font-weight: 600;
    padding: 1rem;
}

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

.table-hover tbody tr:hover {
    background-color: rgba(0,102,204,0.05);
}

.badge {
    padding: 0.5rem 1rem;
    font-weight: 500;
    font-size: 0.85rem;
}

/* Dashboard Footer */
.dashboard-footer {
    background: white;
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--border-color);
    margin-top: auto;
}

.dashboard-footer p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.dashboard-footer a {
    color: var(--primary-color);
    text-decoration: none;
}

.dashboard-footer a:hover {
    text-decoration: underline;
}

/* ===== ANIMATIONS ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* ===== RESPONSIVE STYLES ===== */
@media (max-width: 992px) {
    .sidebar {
        left: -260px;
    }
    
    .sidebar.show {
        left: 0;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .stats-card {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 768px) {
    .login-card {
        padding: 2rem 1.5rem;
    }
    
    .brand-name {
        font-size: 2.5rem;
    }
    
    .logo-circle {
        width: 100px;
        height: 100px;
    }
    
    .logo-circle i {
        font-size: 3rem;
    }
    
    .dashboard-content {
        padding: 1rem;
    }
    
    .top-navbar {
        padding: 1rem;
    }
}

@media (max-width: 576px) {
    .splash-container {
        padding: 1rem;
    }
    
    .brand-name {
        font-size: 2rem;
    }
    
    .welcome-title {
        font-size: 1.5rem;
    }
    
    .login-card {
        padding: 1.5rem;
    }
}

/* ===== UTILITY CLASSES ===== */
.text-primary {
    color: var(--primary-color) !important;
}

.text-success {
    color: var(--success-color) !important;
}

.text-danger {
    color: var(--danger-color) !important;
}

.text-warning {
    color: var(--warning-color) !important;
}

.bg-primary {
    background-color: var(--primary-color) !important;
}

.bg-success {
    background-color: var(--success-color) !important;
}

.bg-danger {
    background-color: var(--danger-color) !important;
}

.bg-warning {
    background-color: var(--warning-color) !important;
}
