/* 
 * CSS principal pour le portail CSE
 * Styles globaux et spécifiques pour l'interface publique
 */

/* --- VARIABLES CSS --- */
:root {
    --primary-color: #3c67b5;
    --secondary-color: #e67e22;
    --light-color: #f9f9f9;
    --dark-color: #333;
    --danger-color: #e74c3c;
    --success-color: #2ecc71;
    --background-gradient: linear-gradient(135deg, #f5f7fa 0%, #e4e9f2 100%);
}

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

html, body {
    height: 100%;
    font-family: 'Roboto', sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: var(--dark-color);
}

body {
    background: var(--background-gradient);
    min-height: 100vh;
    overflow-x: hidden;
}

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

a:hover {
    color: #2e5298;
}

img {
    max-width: 100%;
    height: auto;
}

/* --- LAYOUT --- */
.header {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    z-index: 100;
}

.header h1 {
    font-size: 1.5rem;
    font-weight: 500;
}

.back-button {
    background: none;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 5px;
    margin-right: 10px;
}

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

.page {
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    padding: 20px;
    margin-bottom: 20px;
}

.page h2 {
    margin-bottom: 20px;
    color: #2c3e50;
    font-weight: 500;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

/* --- NAVIGATION --- */
.main-menu {
    display: flex;
    justify-content: space-around;
    background-color: white;
    padding: 10px 0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    border-radius: 10px;
}

.menu-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

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

.menu-item.active {
    background-color: rgba(60, 103, 181, 0.1);
    color: var(--primary-color);
}

.menu-icon {
    font-size: 1.5rem;
    margin-bottom: 5px;
}

.menu-label {
    font-size: 0.9rem;
    text-align: center;
}

.user-menu-toggle {
    position: relative;
    cursor: pointer;
    font-size: 1.5rem;
}

.user-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background-color: white;
    border-radius: 5px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
    min-width: 180px;
    display: none;
    z-index: 100;
}

.user-menu-toggle:hover .user-menu {
    display: block;
}

.user-menu a {
    display: block;
    padding: 10px 15px;
    color: #333;
    transition: background-color 0.3s;
}

.user-menu a:hover {
    background-color: #f5f5f5;
}

.login-link {
    color: white;
    font-size: 1.2rem;
}

/* --- FORMS --- */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(60, 103, 181, 0.2);
}

.form-control.is-invalid {
    border-color: #dc3545;
}

.form-error {
    color: #dc3545;
    font-size: 0.85rem;
    margin-top: 5px;
    display: block;
}

.btn {
    display: inline-block;
    padding: 12px 20px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn:hover {
    background-color: #2e5298;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.btn-block {
    display: block;
    width: 100%;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 0.85rem;
}

.btn-danger {
    background-color: #dc3545;
}

.btn-danger:hover {
    background-color: #c82333;
}

/* --- ALERTS --- */
.alert {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
}

.alert-danger {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.alert-success {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.alert-info {
    background-color: #d1ecf1;
    border: 1px solid #bee5eb;
    color: #0c5460;
}

/* --- LOGIN PAGE --- */
#login-page {
    max-width: 500px;
    margin: 0 auto;
}

.login-form {
    margin-bottom: 20px;
}

.password-container {
    position: relative;
}

.toggle-password {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: #6c757d;
}

.forgot-password {
    text-align: center;
    margin-top: 10px;
}

.login-help {
    text-align: center;
    font-size: 0.9rem;
    color: #6c757d;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

/* --- MODAL --- */
.modal-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background-color: white;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
}

.modal-header h3 {
    margin: 0;
    font-weight: 500;
}

.close-modal {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #6c757d;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.btn-cancel {
    padding: 8px 15px;
    background-color: #6c757d;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.btn-cancel:hover {
    background-color: #5a6268;
}

.btn-confirm {
    padding: 8px 15px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.btn-confirm:hover {
    background-color: #0069d9;
}

/* --- PDF VIEWER --- */
.selector {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.selector select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: white;
    font-size: 0.9rem;
}

.pdf-container {
    position: relative;
    height: 70vh;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
}

.pdf-controls {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 10px;
    z-index: 10;
}

.pdf-control-group {
    display: flex;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.1);
}

.pdf-control-group button {
    background: none;
    border: none;
    padding: 8px 12px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.pdf-control-group button:hover {
    background-color: #f0f0f0;
}

.pdf-viewer {
    width: 100%;
    height: 100%;
    border: none;
}

.loading-indicator {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: rgba(255, 255, 255, 0.8);
    z-index: 5;
}

.no-document {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 50px 20px;
    color: #6c757d;
    text-align: center;
}

.no-document i {
    font-size: 3rem;
    margin-bottom: 20px;
    opacity: 0.3;
}

/* --- HOME PAGE --- */
.welcome-banner {
    background-color: var(--primary-color);
    color: white;
    padding: 40px 20px;
    text-align: center;
    margin-bottom: 30px;
    border-radius: 10px;
    background-image: linear-gradient(135deg, var(--primary-color), #2e5298);
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s, transform 0.5s;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.welcome-banner.show {
    opacity: 1;
    transform: translateY(0);
}

.welcome-content h1 {
    margin-bottom: 10px;
    font-weight: 300;
    font-size: 2rem;
}

.welcome-content p {
    font-size: 1.1rem;
    opacity: 0.9;
}

.home-sections {
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

/* Style spécifique pour que welcome-cse prenne toute la largeur */
.home-sections .welcome-cse {
    grid-column: 1 / -1;
}

.home-section {
    background-color: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s ease;
    transition-delay: calc(var(--order, 0) * 0.1s);
}

.home-section.show {
    opacity: 1;
    transform: translateY(0);
}

.home-section h2 {
    margin-bottom: 20px;
    font-weight: 500;
    color: #2c3e50;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.documents-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 15px;
}

.document-card {
    display: flex;
    align-items: center;
    padding: 15px;
    border-radius: 10px;
    background-color: #f8f9fa;
    transition: all 0.3s ease;
    cursor: pointer;
    border: 1px solid transparent;
}

.document-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    border-color: var(--primary-color);
    background-color: rgba(60, 103, 181, 0.02);
}

.document-card.empty {
    opacity: 0.7;
}

.document-icon {
    font-size: 2rem;
    margin-right: 15px;
    color: var(--primary-color);
}

.document-info h3 {
    font-size: 1rem;
    margin-bottom: 5px;
}

.document-date {
    font-size: 0.85rem;
    color: #6c757d;
}

.no-doc {
    font-size: 0.85rem;
    color: #6c757d;
    font-style: italic;
}

.items-carousel {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.activity-card {
    border-radius: 10px;
    overflow: hidden;
    background-color: white;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    border: 1px solid #f0f0f0;
}

.activity-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
    border-color: var(--primary-color);
}

.activity-date {
    background-color: var(--primary-color);
    color: white;
    padding: 10px;
    text-align: center;
}

.date-day {
    font-size: 1.5rem;
    font-weight: 700;
    display: block;
}

.date-month {
    font-size: 0.85rem;
    text-transform: uppercase;
}

.activity-info {
    padding: 15px;
}

.activity-info h3 {
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.activity-location, .activity-time {
    font-size: 0.9rem;
    color: #6c757d;
    margin-bottom: 5px;
}

.activity-description {
    font-size: 0.9rem;
    margin-top: 10px;
}

.btn-more {
    display: block;
    text-align: center;
    padding: 8px;
    background-color: #f0f0f0;
    color: #333;
    text-decoration: none;
    transition: background-color 0.3s;
}

.btn-more:hover {
    background-color: #e0e0e0;
}

.section-footer {
    text-align: center;
    margin-top: 20px;
}

.btn-view-all {
    display: inline-block;
    padding: 8px 15px;
    border-radius: 4px;
    background-color: #f0f0f0;
    color: #333;
    transition: background-color 0.3s;
}

.btn-view-all:hover {
    background-color: #e0e0e0;
}

.subsidies-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.subsidy-card {
    padding: 15px;
    border-radius: 8px;
    background-color: #f8f9fa;
    transition: transform 0.3s, box-shadow 0.3s;
}

.subsidy-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.subsidy-card h3 {
    font-size: 1rem;
    margin-bottom: 10px;
}

.subsidy-description {
    font-size: 0.85rem;
    color: #6c757d;
    margin-bottom: 10px;
}

.subsidy-price {
    margin-bottom: 10px;
}

.current-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: #28a745;
    margin-right: 5px;
}

.original-price {
    font-size: 0.9rem;
    text-decoration: line-through;
    color: #6c757d;
}

.subsidy-availability {
    font-size: 0.85rem;
    color: #6c757d;
}

.news-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.news-item {
    padding: 15px;
    border-radius: 8px;
    background-color: #f8f9fa;
    transition: transform 0.3s, box-shadow 0.3s;
}

.news-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.news-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.news-header h3 {
    font-size: 1.1rem;
    margin: 0;
}

.news-date {
    font-size: 0.85rem;
    color: #6c757d;
}

.news-content {
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.news-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
}

.news-author {
    color: #6c757d;
}

.btn-read-more {
    color: #007bff;
}

.profile-section {
    grid-column: 1 / -1;
}

.profile-summary {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.profile-avatar {
    font-size: 4rem;
    color: #3498db;
}

.profile-info {
    flex: 1;
}

.profile-info h3 {
    margin-bottom: 5px;
}

.profile-role {
    font-size: 0.9rem;
    color: #6c757d;
    margin-bottom: 15px;
}

.user-activities, .user-subsidies {
    margin-bottom: 15px;
}

.user-activities h4, .user-subsidies h4 {
    font-size: 1rem;
    margin-bottom: 10px;
    color: #2c3e50;
}

.user-activities ul, .user-subsidies ul {
    list-style: none;
}

.user-activities li, .user-subsidies li {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    border-bottom: 1px solid #eee;
}

.activity-name, .subsidy-name {
    font-weight: 500;
}

.activity-date, .subsidy-date {
    font-size: 0.85rem;
    color: #6c757d;
}

.profile-actions {
    display: flex;
    gap: 10px;
}

.btn-profile, .btn-admin {
    display: inline-block;
    padding: 8px 15px;
    border-radius: 4px;
    background-color: #3498db;
    color: white;
    transition: background-color 0.3s;
}

.btn-profile:hover, .btn-admin:hover {
    background-color: #2980b9;
    color: white;
}

.btn-admin {
    background-color: #2c3e50;
}

.btn-admin:hover {
    background-color: #1e2b38;
}

.no-items {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    color: #6c757d;
    text-align: center;
}

.no-items i {
    font-size: 2rem;
    margin-bottom: 10px;
    opacity: 0.3;
}

/* --- ACTIVITIES PAGE --- */
.calendar-container {
    margin-bottom: 30px;
}

.calendar-view {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    background-color: #f8f9fa;
    border-radius: 4px;
    font-weight: 500;
}

.day-header {
    background-color: #e9ecef;
    font-weight: bold;
}

.calendar-day.empty {
    background-color: transparent;
}

.calendar-day.today {
    background-color: #e6f2ff;
    border: 1px solid #007bff;
}

.calendar-day.has-event {
    cursor: pointer;
    background-color: #d4edda;
    transition: transform 0.3s, box-shadow 0.3s;
}

.calendar-day.has-event:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.event-indicator {
    position: absolute;
    top: 5px;
    right: 5px;
    font-size: 0.7rem;
}

.event-badge {
    position: absolute;
    top: 5px;
    left: 5px;
    background-color: #3498db;
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.7rem;
}

.activity-popup-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.popup-content {
    background-color: white;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    position: relative;
    padding: 20px;
}

.close-popup {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #6c757d;
}

.activity-item {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.activity-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.activity-item h3 {
    margin-bottom: 10px;
    color: #2c3e50;
}

.pdf-status {
    font-style: italic;
    color: #6c757d;
    font-size: 0.9rem;
}

/* --- SUBSIDIES PAGE --- */
.subvention-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.subvention-item {
    display: flex;
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s, box-shadow 0.3s;
}

.subvention-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.subvention-item.unavailable {
    opacity: 0.6;
}

.subvention-details {
    flex: 1;
}

.subvention-details h3 {
    margin-bottom: 10px;
    color: #2c3e50;
}

.price-info {
    margin-top: 10px;
}

.price-badge {
    background-color: #28a745;
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-weight: 700;
}

.original-price {
    margin-left: 10px;
    text-decoration: line-through;
    color: #6c757d;
}

.subvention-status {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-end;
    gap: 10px;
    min-width: 150px;
}

.limit-badge, .quota-info, .sold-out-badge, .available-badge {
    font-size: 0.85rem;
    padding: 3px 8px;
    border-radius: 4px;
    background-color: #f0f0f0;
    color: #6c757d;
}

.sold-out-badge {
    background-color: #dc3545;
    color: white;
}

.available-badge {
    background-color: #28a745;
    color: white;
}

.login-prompt {
    text-align: center;
    margin-top: 30px;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
}

.cart-summary {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.2);
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
    z-index: 90;
}

.cart-info {
    display: flex;
    flex-direction: column;
}

#cart-count {
    font-size: 0.85rem;
    color: #6c757d;
}

#cart-total {
    font-weight: 700;
    color: #28a745;
}

.notification {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.2);
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 95;
    transform: translateY(100px);
    opacity: 0;
    transition: transform 0.3s, opacity 0.3s;
    max-width: 300px;
}

.notification.show {
    transform: translateY(0);
    opacity: 1;
}

.notification-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.notification-content i {
    font-size: 1.2rem;
}

.notification.success i {
    color: #28a745;
}

.notification.info i {
    color: #17a2b8;
}

.notification.error i {
    color: #dc3545;
}

.close-notification {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    color: #6c757d;
}

.quantity-selector {
    margin: 20px 0;
}

.quantity-controls {
    display: flex;
    align-items: center;
    width: 120px;
    margin-top: 5px;
}

.btn-quantity {
    width: 30px;
    height: 30px;
    background-color: #f0f0f0;
    border: 1px solid #ddd;
    font-weight: bold;
    cursor: pointer;
}

.quantity-controls input {
    width: 60px;
    height: 30px;
    text-align: center;
    border: 1px solid #ddd;
    border-left: none;
    border-right: none;
}

.total-info {
    font-weight: bold;
    margin-top: 15px;
}

/* --- SALES PAGE --- */
.sales-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.sales-left, .sales-right {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.card {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.card-header {
    padding: 15px;
    background-color: #f8f9fa;
    border-bottom: 1px solid #eee;
}

.card-header h3 {
    margin: 0;
    font-weight: 500;
    color: #2c3e50;
}

.card-body {
    padding: 15px;
}

.beneficiary-selector {
    margin-bottom: 20px;
}

.search-box {
    position: relative;
    margin-top: 10px;
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: white;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 4px 4px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 10;
}

.search-result-item {
    padding: 10px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.search-result-item:hover {
    background-color: #f5f5f5;
}

.no-results {
    padding: 10px;
    color: #6c757d;
    font-style: italic;
}

.beneficiary-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 4px;
    margin-bottom: 20px;
}

.beneficiary-details h4 {
    margin: 0;
    font-weight: 500;
}

.beneficiary-details p {
    margin: 5px 0 0;
    font-size: 0.85rem;
    color: #6c757d;
}

.products-container {
    max-height: 400px;
    overflow-y: auto;
}

.products-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.product-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 4px;
    transition: transform 0.3s, box-shadow 0.3s;
}

.product-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.product-info h5 {
    margin: 0 0 5px;
    font-weight: 500;
}

.product-price {
    font-size: 0.9rem;
}

.price {
    font-weight: 700;
    color: #28a745;
}

.original-price {
    color: #6c757d;
    text-decoration: line-through;
    margin-left: 5px;
}

.btn-add-product {
    width: 30px;
    height: 30px;
    background-color: #28a745;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background-color 0.3s;
}

.btn-add-product:hover {
    background-color: #218838;
}

.cart-container {
    min-height: 200px;
}

.empty-cart {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 150px;
    color: #6c757d;
}

.empty-cart i {
    font-size: 2rem;
    margin-bottom: 10px;
    opacity: 0.3;
}

.cart-items {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 15px;
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid #eee;
}

.item-info {
    flex: 1;
}

.item-title {
    display: block;
    font-weight: 500;
    margin-bottom: 5px;
}

.item-quantity {
    display: flex;
    align-items: center;
    gap: 5px;
}

.btn-qty {
    width: 24px;
    height: 24px;
    background-color: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
}

.item-price {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-remove {
    background: none;
    border: none;
    color: #dc3545;
    cursor: pointer;
}

.cart-summary {
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 4px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
}

.summary-row:last-child {
    margin-bottom: 0;
}

.cart-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 15px;
}

.recent-orders {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.order-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 4px;
}

.order-info h5 {
    margin: 0 0 5px;
    font-weight: 500;
}

.order-date, .order-customer {
    font-size: 0.85rem;
    color: #6c757d;
}

.order-customer {
    margin-left: 10px;
}

.order-amount {
    text-align: right;
}

.status-badge {
    display: block;
    font-size: 0.8rem;
    padding: 2px 5px;
    border-radius: 4px;
    margin-top: 5px;
    text-align: center;
}

.status-pending {
    background-color: #ffc107;
    color: #212529;
}

.status-processing {
    background-color: #17a2b8;
    color: white;
}

.status-completed {
    background-color: #28a745;
    color: white;
}

.status-cancelled {
    background-color: #dc3545;
    color: white;
}

.order-actions {
    display: flex;
    gap: 5px;
}

.checkout-customer-info {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.checkout-items {
    margin-bottom: 15px;
}

.checkout-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.total-row {
    font-weight: 700;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #ddd;
}

.payment-method, .additional-notes {
    margin-top: 20px;
}

.radio-container {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    cursor: pointer;
}

.radio-label {
    margin-left: 10px;
}

/* --- RESPONSIVE STYLES --- */
@media (max-width: 768px) {
    .header h1 {
        font-size: 1.2rem;
    }
    
    .content-container {
        padding: 10px;
    }
    
    .page {
        padding: 15px;
    }
    
    .menu-icon {
        font-size: 1.2rem;
    }
    
    .menu-label {
        font-size: 0.8rem;
    }
    
    .home-sections {
        grid-template-columns: 1fr;
    }
    
    .home-sections .welcome-cse {
        grid-column: 1 / -1;
    }
    
    .profile-summary {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .calendar-day {
        font-size: 0.8rem;
    }
    
    .subvention-item {
        flex-direction: column;
    }
    
    .subvention-status {
        margin-top: 15px;
        align-items: flex-start;
    }
    
    .sales-layout {
        grid-template-columns: 1fr;
    }
}

/* --- PORTRAIT MODE --- */
.portrait-mode .main-menu {
    flex-wrap: wrap;
}

.portrait-mode .menu-item {
    width: 33.33%;
}

.portrait-mode .pdf-container {
    height: 80vh;
}

.portrait-mode .documents-container,
.portrait-mode .items-carousel,
.portrait-mode .subsidies-grid {
    grid-template-columns: 1fr;
}

.portrait-mode .subvention-item {
    flex-direction: column;
}

.portrait-mode .subvention-status {
    margin-top: 15px;
    align-items: flex-start;
}

/* --- PROFILE IMPROVED STYLES --- */

/* Structure des onglets */
.profile-tabs {
    margin-top: 20px;
}

.nav-tabs {
    display: flex;
    list-style: none;
    padding: 0 15px;
    margin: 0;
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

.nav-item {
    margin-bottom: -1px;
}

.nav-link {
    display: block;
    padding: 10px 15px;
    border: 1px solid transparent;
    border-top-left-radius: 0.25rem;
    border-top-right-radius: 0.25rem;
    color: #495057;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
}

.nav-link.active {
    color: #3498db;
    background-color: #fff;
    border-color: #dee2e6 #dee2e6 #fff;
}

.tab-content {
    padding: 20px;
    background-color: #fff;
    border-left: 1px solid #dee2e6;
    border-right: 1px solid #dee2e6;
    border-bottom: 1px solid #dee2e6;
    border-bottom-left-radius: 0.25rem;
    border-bottom-right-radius: 0.25rem;
}

.tab-pane {
    display: none;
}

.tab-pane.show.active {
    display: block;
}

/* Styles pour l'avatar */
.profile-avatar {
    position: relative;
    margin-right: 20px;
}

.profile-avatar-img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #fff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.avatar-change-btn {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: #3498db;
    color: white;
    border: 2px solid #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    font-size: 14px;
}

/* Améliorations du profil */
.profile-container {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    overflow: hidden;
}

.profile-header {
    display: flex;
    align-items: center;
    padding: 20px;
    background-color: #f8f9fa;
    border-bottom: 1px solid #eee;
}

.profile-title {
    flex: 1;
}

.profile-title h3 {
    margin: 0 0 5px;
    color: #2c3e50;
}

.profile-role {
    font-size: 0.9rem;
    color: #6c757d;
    font-style: italic;
}

/* Sections du profil */
.profile-section, .security-section, .activity-section, .form-section {
    margin-bottom: 30px;
}

.profile-section h4, .security-section h4, .activity-section h4, .form-section h4 {
    margin-bottom: 15px;
    color: #2c3e50;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

/* Informations profil */
.profile-info .info-row {
    display: flex;
    margin-bottom: 10px;
    padding: 5px 0;
}

.info-label {
    width: 150px;
    font-weight: 600;
    color: #6c757d;
}

.info-value {
    flex: 1;
}

/* Contacts d'urgence */
.emergency-contact-card {
    margin-bottom: 15px;
    border: 1px solid #e9ecef;
    border-radius: 0.25rem;
    overflow: hidden;
}

.emergency-contact-card .card-header {
    padding: 10px 15px;
    background-color: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.emergency-contact-card .card-header h5 {
    margin: 0;
    font-size: 1rem;
}

.emergency-contact-card .card-body {
    padding: 15px;
}

.badge {
    display: inline-block;
    padding: 0.25em 0.4em;
    font-size: 75%;
    font-weight: 700;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 0.25rem;
}

.badge-primary {
    color: #fff;
    background-color: #3498db;
}

/* Indicateurs de statut */
.activity-status, .purchase-status {
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
}

.status-pending {
    background-color: #ffc107;
    color: #212529;
}

.status-confirmed {
    background-color: #28a745;
    color: white;
}

.status-cancelled {
    background-color: #dc3545;
    color: white;
}

.status-unknown {
    background-color: #6c757d;
    color: white;
}

/* Tableaux */
.purchases-table {
    width: 100%;
    border-collapse: collapse;
}

.purchases-table th, .purchases-table td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.purchases-table th {
    background-color: #f8f9fa;
    font-weight: 600;
}

/* Sécurité améliorée */
.login-history {
    margin-top: 20px;
}

.login-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.login-list li {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
    font-size: 0.9rem;
}

.login-ip {
    color: #6c757d;
}

.password-strength {
    margin-top: 5px;
    font-size: 0.8rem;
    height: 20px;
}

.password-strength.weak {
    color: #dc3545;
}

.password-strength.medium {
    color: #ffc107;
}

.password-strength.strong {
    color: #28a745;
}

/* Aperçu d'avatar */
.avatar-preview-container {
    margin-top: 15px;
    text-align: center;
}

#avatar-preview {
    max-width: 100%;
    max-height: 200px;
    border-radius: 0.25rem;
}

/* Lorsqu'il n'y a pas de données */
.no-data {
    padding: 20px;
    text-align: center;
    color: #6c757d;
    background-color: #f8f9fa;
    border-radius: 8px;
    margin-top: 10px;
}

/* Styles additionnels pour le responsive */
@media (max-width: 768px) {
    .form-row {
        flex-direction: column;
    }
    
    .col-md-6, .col-md-4, .col-md-8 {
        max-width: 100%;
        flex: 0 0 100%;
    }
    
    .nav-tabs {
        flex-wrap: wrap;
    }
    
    .nav-item {
        width: 50%;
        text-align: center;
    }
    
    .profile-info .info-row {
        flex-direction: column;
    }
    
    .info-label {
        width: 100%;
        margin-bottom: 5px;
    }
    
    .activity-item {
        flex-direction: column;
    }
}

/* === STYLES POUR LA SECTION DE BIENVENUE CSE === */
.welcome-cse {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border: 2px solid var(--primary-color);
    border-radius: 12px;
    padding: 50px;
    margin: 40px 0;
    box-shadow: 0 8px 25px rgba(60, 103, 181, 0.1);
    min-height: 600px;
    width: 100%;
    max-width: none;
    grid-column: 1 / -1;
}

.cse-welcome-header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 2px solid #e9ecef;
}

.cse-welcome-header i {
    font-size: 4rem;
    color: var(--secondary-color);
    margin-bottom: 20px;
    display: block;
}

.cse-welcome-header h2 {
    color: var(--primary-color);
    font-size: 2.5rem;
    font-weight: 600;
    margin: 0;
}

.welcome-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: start;
}

.welcome-message p {
    margin-bottom: 20px;
    font-size: 1.2rem;
    line-height: 1.7;
}

.benefits-list {
    margin-top: 25px;
}

.benefits-list .benefit-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 25px;
    padding: 20px;
    background: rgba(60, 103, 181, 0.05);
    border-radius: 10px;
    border-left: 4px solid var(--primary-color);
}

.benefits-list .benefit-item i {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-right: 15px;
    margin-top: 5px;
    min-width: 24px;
}

.benefits-list .benefit-item h4 {
    margin: 0 0 5px 0;
    color: var(--dark-color);
    font-size: 1.1rem;
    font-weight: 600;
}

.benefits-list .benefit-item p {
    margin: 0;
    color: #6c757d;
    font-size: 0.95rem;
    line-height: 1.4;
}

.login-guide {
    background: white;
    padding: 35px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.login-guide h3 {
    color: var(--primary-color);
    margin-bottom: 20px;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
}

.login-guide h3 i {
    margin-right: 10px;
    font-size: 1.2rem;
}

.login-steps {
    margin-bottom: 25px;
}

.step {
    display: flex;
    align-items: flex-start;
    margin-bottom: 15px;
    padding: 10px 0;
}

.step-number {
    background: var(--primary-color);
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-right: 15px;
    flex-shrink: 0;
    font-size: 0.9rem;
}

.step p {
    margin: 0;
    font-size: 1rem;
    line-height: 1.5;
    margin-top: 2px;
}

.help-info {
    background: rgba(231, 126, 34, 0.1);
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid var(--secondary-color);
    margin-bottom: 25px;
}

.help-info i {
    color: var(--secondary-color);
    margin-right: 8px;
}

.help-info p {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.4;
}

.login-action {
    text-align: center;
}

.btn-large {
    padding: 20px 40px;
    font-size: 1.3rem;
    font-weight: 600;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(60, 103, 181, 0.3);
    transition: all 0.3s ease;
}

.btn-large:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(60, 103, 181, 0.4);
}

.btn-large i {
    margin-right: 10px;
    font-size: 1rem;
}

/* Responsive pour la section de bienvenue */
@media (max-width: 768px) {
    .welcome-content {
        grid-template-columns: 1fr;
        gap: 25px;
    }
    
    .welcome-cse {
        padding: 20px;
        margin: 20px 10px;
    }
    
    .cse-welcome-header h2 {
        font-size: 1.5rem;
    }
    
    .cse-welcome-header i {
        font-size: 2.5rem;
    }
    
    .benefits-list .benefit-item {
        flex-direction: column;
        text-align: center;
    }
    
    .benefits-list .benefit-item i {
        margin-right: 0;
        margin-bottom: 10px;
    }
    
    .login-guide {
        padding: 20px;
    }
    
    .step {
        flex-direction: column;
        text-align: center;
    }
    
    .step-number {
        margin-right: 0;
        margin-bottom: 10px;
    }
}