/* Reset et styles de base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --accent-color: #e74c3c;
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --text-color: #333;
    --text-light: #7f8c8d;
    --bg-color: #ecf0f1;
    --white: #ffffff;
    --border-color: #ddd;
    --shadow: 0 2px 10px rgba(0,0,0,0.1);
    --shadow-hover: 0 5px 20px rgba(0,0,0,0.15);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
}

/* Header */
header {
    background: linear-gradient(135deg, var(--primary-color) 0%, #34495e 100%);
    color: var(--white);
    padding: 0;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-top {
    background: rgba(0,0,0,0.2);
    padding: 10px 0;
}

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

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 28px;
    font-weight: bold;
    color: var(--white);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-icon {
    font-size: 36px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 20px;
    font-size: 14px;
}

.user-info a {
    color: var(--white);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 5px;
    transition: all 0.3s;
}

.user-info a:hover {
    background: rgba(255,255,255,0.1);
}

.btn {
    display: inline-block;
    padding: 10px 20px;
    background: var(--secondary-color);
    color: var(--white);
    text-decoration: none;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
}

.btn:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

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

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

.btn-danger {
    background: var(--accent-color);
}

.btn-warning {
    background: var(--warning-color);
}

.btn-small {
    padding: 6px 12px;
    font-size: 13px;
}

/* Navigation */
nav {
    padding: 15px 0;
}

nav ul {
    list-style: none;
    display: flex;
    gap: 30px;
    justify-content: center;
}

nav a {
    color: var(--white);
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 5px;
    transition: all 0.3s;
    position: relative;
}

nav a:hover,
nav a.active {
    background: rgba(255,255,255,0.15);
}

nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--white);
    transition: all 0.3s;
    transform: translateX(-50%);
}

nav a:hover::after,
nav a.active::after {
    width: 80%;
}

/* Main Content */
main {
    min-height: calc(100vh - 300px);
    padding: 40px 0;
}

.page-title {
    text-align: center;
    margin-bottom: 40px;
    color: var(--primary-color);
}

.page-title h1 {
    font-size: 36px;
    margin-bottom: 10px;
}

.page-title p {
    color: var(--text-light);
    font-size: 18px;
}

/* Cards */
.card {
    background: var(--white);
    border-radius: 10px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: var(--shadow);
    transition: all 0.3s;
}

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

.card-header {
    border-bottom: 2px solid var(--bg-color);
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.card-header h2 {
    color: var(--primary-color);
    font-size: 24px;
}

.card-body {
    color: var(--text-color);
}

/* Grid */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.grid-2 {
    grid-template-columns: repeat(auto-fill, minmax(450px, 1fr));
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-color);
}

.form-control {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 5px;
    font-size: 14px;
    transition: all 0.3s;
}

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

textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

select.form-control {
    cursor: pointer;
}

/* Alerts */
.alert {
    padding: 15px 20px;
    border-radius: 5px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border-left: 4px solid var(--success-color);
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border-left: 4px solid var(--accent-color);
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border-left: 4px solid var(--warning-color);
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border-left: 4px solid var(--secondary-color);
}

/* Tables */
.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

thead {
    background: var(--primary-color);
    color: var(--white);
}

th, td {
    padding: 15px;
    text-align: left;
}

tbody tr {
    border-bottom: 1px solid var(--border-color);
    transition: all 0.3s;
}

tbody tr:hover {
    background: var(--bg-color);
}

tbody tr:last-child {
    border-bottom: none;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

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

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

.badge-warning {
    background: var(--warning-color);
    color: var(--white);
}

.badge-info {
    background: var(--secondary-color);
    color: var(--white);
}

.badge-secondary {
    background: var(--text-light);
    color: var(--white);
}

/* Stats Cards */
.stats-card {
    background: linear-gradient(135deg, var(--secondary-color) 0%, #2980b9 100%);
    color: var(--white);
    padding: 25px;
    border-radius: 10px;
    box-shadow: var(--shadow);
    transition: all 0.3s;
}

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

.stats-card-icon {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.8;
}

.stats-card-value {
    font-size: 36px;
    font-weight: bold;
    margin-bottom: 5px;
}

.stats-card-label {
    font-size: 14px;
    opacity: 0.9;
}

/* Tournament Card Specific */
.tournament-card {
    position: relative;
    overflow: hidden;
}

.tournament-status {
    position: absolute;
    top: 15px;
    right: 15px;
}

.tournament-info {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 15px 0;
}

.tournament-info-item {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-color);
}

.tournament-info-item i {
    color: var(--secondary-color);
    font-size: 18px;
    width: 25px;
}

.tournament-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid var(--bg-color);
}

/* News Card */
.news-card {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.news-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 10px 10px 0 0;
    margin: -25px -25px 20px -25px;
}

.news-date {
    color: var(--text-light);
    font-size: 14px;
    margin-bottom: 10px;
}

.news-title {
    color: var(--primary-color);
    font-size: 20px;
    margin-bottom: 15px;
}

.news-excerpt {
    flex-grow: 1;
    color: var(--text-color);
    line-height: 1.6;
}

/* Footer */
footer {
    background: var(--primary-color);
    color: var(--white);
    padding: 40px 0 20px;
    margin-top: 60px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.footer-section h3 {
    margin-bottom: 20px;
    color: var(--white);
}

.footer-section p,
.footer-section a {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    line-height: 2;
}

.footer-section a:hover {
    color: var(--white);
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.6);
}

/* Responsive */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 15px;
    }
    
    nav ul {
        flex-direction: column;
        gap: 10px;
        align-items: center;
    }
    
    .grid,
    .grid-2 {
        grid-template-columns: 1fr;
    }
    
    .tournament-footer {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    .table-container {
        font-size: 14px;
    }
    
    th, td {
        padding: 10px;
    }
}

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

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

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
}

.modal-content {
    background: var(--white);
    margin: 5% auto;
    padding: 30px;
    border-radius: 10px;
    width: 90%;
    max-width: 600px;
    position: relative;
    animation: fadeIn 0.3s;
}

.modal-close {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 28px;
    font-weight: bold;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.3s;
}

.modal-close:hover {
    color: var(--accent-color);
}

/* Loading Spinner */
.spinner {
    border: 4px solid var(--bg-color);
    border-top: 4px solid var(--secondary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Menu Burger */
.burger-menu {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    z-index: 1001;
}

.burger-menu span {
    width: 25px;
    height: 3px;
    background: var(--white);
    border-radius: 3px;
    transition: all 0.3s ease;
}

.burger-menu.active span:nth-child(1) {
    transform: rotate(45deg) translate(7px, 7px);
}

.burger-menu.active span:nth-child(2) {
    opacity: 0;
}

.burger-menu.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* Menu mobile unifié - caché par défaut */
.mobile-menu-container {
    display: none;
}

.user-info-mobile {
    display: none;
}

/* Mobile Menu Styles */
@media (max-width: 768px) {
    .burger-menu {
        display: flex;
    }
    
    /* Cacher le menu desktop */
    #mainNavDesktop {
        display: none;
    }
    
    /* Cacher le user-info desktop sur mobile */
    .user-info {
        display: none !important;
    }
    
    /* Menu unifié à gauche */
    .mobile-menu-container {
        display: block;
        position: fixed;
        top: 60px;
        left: -100%;
        width: 280px;
        height: calc(100vh - 60px);
        background: var(--primary-color);
        transition: left 0.3s ease;
        box-shadow: 5px 0 15px rgba(0,0,0,0.3);
        overflow-y: auto;
        z-index: 1000;
    }
    
    .mobile-menu-container.active {
        left: 0;
    }
    
    /* Navigation mobile */
    .mobile-menu-container nav {
        padding: 0;
    }
    
    .mobile-menu-container nav ul {
        flex-direction: column;
        padding: 0;
        margin: 0;
    }
    
    .mobile-menu-container nav ul li {
        width: 100%;
        margin: 0;
    }
    
    .mobile-menu-container nav ul li a {
        display: block;
        padding: 15px 20px;
        border-bottom: 1px solid rgba(255,255,255,0.1);
        color: white;
        text-decoration: none;
    }
    
    .mobile-menu-container nav ul li a i {
        margin-right: 10px;
        width: 20px;
        text-align: center;
    }
    
    /* User Info mobile */
    .user-info-mobile {
        display: block;
        border-top: 2px solid rgba(255,255,255,0.2);
        margin-top: 20px;
    }
    
    body.menu-open {
        overflow: hidden;
    }
    
    body.menu-open::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.5);
        z-index: 999;
    }
}

/* Desktop - Afficher le menu normal */
@media (min-width: 769px) {
    .mobile-menu-container {
        display: none !important;
    }
    
    #mainNavDesktop {
        display: block;
    }
}
