/* Réinitialisation */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Style de background avec effet étoiles */
body {
    background: linear-gradient(to bottom, #ffffff, #c2d7ff);
    min-height: 100vh;
    font-family: Arial, sans-serif;
    position: relative;
    overflow-x: hidden;
}

@keyframes twinkle {
    0%, 100% { 
        opacity: 0.3; 
        transform: scale(1);
    }
    50% { 
        opacity: 1; 
        transform: scale(1.2);
    }
}

/* Action bar */
.action-bar {
    background: linear-gradient(135deg, #000741 0%, #11005d 100%);
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 100;
}

.action-bar-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* Menu hamburger (trois traits horizontaux) */
.menu-icon {
    display: flex;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 5px;
    transition: all 0.3s ease;
}

.menu-icon span {
    width: 30px;
    height: 3px;
    background-color: white;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.menu-icon:hover span {
    background-color: #fff;
    transform: scaleX(1.1);
}

/* Logo dans l'action bar */
.action-bar .logo {
    height: 50px;
    width: auto;
}

/* Boutons sociaux dans l'action bar */
.social-buttons {
    display: flex;
    align-items: center;
    gap: 15px;
}

.social-buttons img {
    width: 80px;
    height: 80px;
    cursor: pointer;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.social-buttons img:hover {
    transform: scale(1.15);
    opacity: 0.8;
}

/* Menu latéral */
.side-menu {
    position: fixed;
    top: 0;
    left: -350px;
    width: 300px;
    height: 100%;
    background: linear-gradient(180deg, #1a1e44 0%, #16183a 100%);
    box-shadow: 2px 0 15px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    transition: left 0.4s ease;
    padding-top: 60px;
}

.side-menu.active {
    left: 0;
}

.menu-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 40px;
    color: white;
    cursor: pointer;
    line-height: 1;
    transition: color 0.3s ease;
}

.menu-close:hover {
    color: #87CEEB;
}

/* Overlay */
.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Styles pour la barre de navigation dans le menu */
.navbar ul {
    list-style-type: none;
    padding: 20px;
}

.navbar li {
    margin: 15px 0;
}

.navbar a {
    position: relative;
    display: block;
    color: white;
    text-decoration: none;
    padding: 15px 20px;
    border: 2px solid transparent;
    border-radius: 25px;
    background-color: rgba(135, 206, 235, 0.2);
    transition: all 0.3s ease;
    text-align: center;
    font-size: 16px;
}

.navbar a:hover {
    background-color: rgba(135, 206, 235, 0.4);
    border-color: #87CEEB;
    transform: translateX(10px);
}

.navbar a span {
    display: block;
}

/* Animation de bordure au hover */
.navbar a::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    border: 2px solid transparent;
    border-radius: 25px;
    pointer-events: none;
}

.navbar a:hover::before,
.navbar a:focus::before {
    animation: borderChange 2s infinite alternate;
}

/* Section Actualités */
.news-section {
    max-width: 1200px;
    margin: 50px auto;
    padding: 0 20px;
    position: relative;
    z-index: 10;
}

.news-title {
    text-align: center;
    font-size: 2.5em;
    color: #11005d;
    margin-bottom: 40px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.news-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
    margin-bottom: 50px;
}

.news-card {
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 7, 65, 0.2);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.news-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 25px rgba(0, 7, 65, 0.3);
}

.news-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.news-content {
    padding: 20px;
}

.news-date {
    display: inline-block;
    font-size: 0.85em;
    color: #666;
    background: #f0f0f0;
    padding: 5px 12px;
    border-radius: 20px;
    margin-bottom: 10px;
}

.news-card-title {
    font-size: 1.4em;
    color: #11005d;
    margin: 15px 0 10px 0;
    line-height: 1.3;
}

.news-description {
    color: #555;
    line-height: 1.6;
    margin-bottom: 15px;
}

.news-link {
    display: inline-block;
    color: #11005d;
    font-weight: bold;
    text-decoration: none;
    transition: color 0.3s ease;
}

.news-link:hover {
    color: #000741;
    text-decoration: underline;
}

.error-message {
    text-align: center;
    color: #666;
    padding: 40px;
    font-size: 1.1em;
}

/* Responsive */
@media (max-width: 768px) {
    .action-bar {
        padding: 10px 15px;
    }
    
    .action-bar .logo {
        height: 35px;
    }
    
    .social-buttons img {
        width: 28px;
        height: 28px;
    }
    
    .side-menu {
        width: 250px;
        left: -250px;
    }

    .news-container {
        grid-template-columns: 1fr;
    }

    .news-title {
        font-size: 2em;
    }
}

/* Boutons Auth dans la barre d'action */
.auth-buttons {
    display: flex;
    gap: 10px;
    align-items: center;
}

.btn-login, .btn-register {
    padding: 8px 20px;
    border-radius: 20px;
    text-decoration: none;
    font-weight: bold;
    transition: all 0.3s ease;
}

.btn-login {
    background: transparent;
    border: 2px solid white;
    color: white;
}

.btn-login:hover {
    background: white;
    color: #11005d;
}

.btn-register {
    background: white;
    color: #11005d;
    border: 2px solid white;
}

.btn-register:hover {
    background: #87CEEB;
    border-color: #87CEEB;
}

/* Menu utilisateur connecté */
.user-menu {
    display: flex;
    gap: 15px;
    align-items: center;
    color: white;
}

.user-name {
    font-weight: bold;
}

.btn-admin, .btn-logout, .btn-home {
    padding: 8px 16px;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
}

.btn-admin {
    background: #ffa500;
    color: white;
}

.btn-admin:hover {
    background: #ff8c00;
}

.btn-logout {
    background: #ff4444;
    color: white;
}

.btn-logout:hover {
    background: #cc0000;
}

.btn-home {
    background: white;
    color: #11005d;
}

.btn-home:hover {
    background: #87CEEB;
}

/* Page d'authentification */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.auth-container {
    background: white;
    border-radius: 20px;
    padding: 40px;
    max-width: 450px;
    width: 100%;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-logo {
    max-width: 200px;
    margin-bottom: 20px;
}

.auth-header h2 {
    color: #11005d;
    font-size: 1.8em;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    color: #333;
    font-weight: bold;
    margin-bottom: 8px;
}

.form-group input, .form-group textarea {
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1em;
    transition: border-color 0.3s ease;
}

.form-group input:focus, .form-group textarea:focus {
    outline: none;
    border-color: #11005d;
}

.form-group small {
    color: #666;
    font-size: 0.85em;
    margin-top: 5px;
}

.error-box {
    background: #ffebee;
    color: #c62828;
    padding: 12px;
    border-radius: 8px;
    border-left: 4px solid #c62828;
}

.btn-submit {
    background: linear-gradient(135deg, #11005d 0%, #000741 100%);
    color: white;
    padding: 14px;
    border: none;
    border-radius: 8px;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.btn-submit:hover {
    transform: translateY(-2px);
}

.auth-footer {
    text-align: center;
    margin-top: 25px;
    color: #666;
}

.auth-footer a {
    color: #11005d;
    font-weight: bold;
    text-decoration: none;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* Page Admin */
.admin-page {
    min-height: 100vh;
    background: #f5f5f5;
}

.admin-header {
    background: linear-gradient(135deg, #000741 0%, #11005d 100%);
    color: white;
    padding: 20px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.admin-logo {
    height: 40px;
}

.admin-header h1 {
    flex-grow: 1;
    text-align: center;
}

.admin-user {
    display: flex;
    gap: 10px;
    align-items: center;
}

.admin-nav {
    background: white;
    padding: 0 40px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    display: flex;
    gap: 10px;
}

.tab-btn {
    padding: 15px 30px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-weight: bold;
    color: #666;
    transition: all 0.3s ease;
}

.tab-btn.active {
    color: #11005d;
    border-bottom-color: #11005d;
}

.tab-btn:hover {
    background: #f5f5f5;
}

.admin-tab {
    display: none;
}

.admin-tab.active {
    display: block;
}

.admin-section {
    padding: 40px;
}

.admin-section h2 {
    color: #11005d;
    margin-bottom: 30px;
    font-size: 2em;
}

.admin-section h3 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.3em;
}

.admin-form-container {
    background: white;
    padding: 30px;
    border-radius: 10px;
    margin-bottom: 40px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.admin-form {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.admin-form .form-group:nth-child(2),
.admin-form .form-group:nth-child(5),
.admin-form .form-group:nth-child(6) {
    grid-column: span 2;
}

.admin-list {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

table {
    width: 100%;
    border-collapse: collapse;
}

table thead {
    background: #f5f5f5;
}

table th {
    padding: 15px;
    text-align: left;
    color: #11005d;
    font-weight: bold;
}

table td {
    padding: 15px;
    border-bottom: 1px solid #eee;
}

table tr:hover {
    background: #f9f9f9;
}

.btn-edit, .btn-delete, .btn-cancel {
    padding: 6px 12px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    margin-right: 5px;
    transition: all 0.3s ease;
}

.btn-edit {
    background: #4CAF50;
    color: white;
}

.btn-edit:hover {
    background: #45a049;
}

.btn-delete {
    background: #f44336;
    color: white;
}

.btn-delete:hover {
    background: #da190b;
}

.btn-cancel {
    background: #999;
    color: white;
}

.btn-cancel:hover {
    background: #666;
}

select {
    padding: 8px;
    border: 2px solid #ddd;
    border-radius: 5px;
    cursor: pointer;
}

select:focus {
    outline: none;
    border-color: #11005d;
}

@media (max-width: 768px) {
    .admin-form {
        grid-template-columns: 1fr;
    }
    
    .admin-form .form-group {
        grid-column: span 1 !important;
    }
    
    table {
        font-size: 0.9em;
    }
}