@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Playfair+Display:wght@600;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: #f8fafc;
    color: #1e293b;
    line-height: 1.6;
    font-size: 15px;
}

/* NAV */
nav {
    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
    padding: 18px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 20px rgba(30, 58, 138, 0.15);
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

nav .logo {
    font-family: 'Playfair Display', serif;
    font-size: 1.6rem;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
    letter-spacing: 0.5px;
}

nav a {
    color: rgba(255,255,255,0.95);
    text-decoration: none;
    margin-left: 25px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
    padding: 8px 16px;
    border-radius: 6px;
}

nav a:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
}

/* CONTAINER */
.container {
    max-width: 1200px;
    margin: 50px auto;
    padding: 0 30px;
}

/* CARD */
.card {
    background: #fff;
    border-radius: 16px;
    padding: 35px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05), 0 10px 25px rgba(0,0,0,0.05);
    margin-bottom: 30px;
    border: 1px solid #e2e8f0;
    transition: all 0.3s;
}

.card:hover {
    box-shadow: 0 4px 6px rgba(0,0,0,0.05), 0 20px 40px rgba(0,0,0,0.08);
}

.card h2 {
    color: #1e293b;
    margin-bottom: 25px;
    font-size: 1.5rem;
    font-weight: 700;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 15px;
    font-family: 'Playfair Display', serif;
}

/* FORMULAIRES */
input, select, textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    font-size: 0.95rem;
    margin-bottom: 18px;
    outline: none;
    transition: all 0.2s;
    font-family: 'Inter', sans-serif;
    background: #f8fafc;
}

input:focus, select:focus, textarea:focus {
    border-color: #2563eb;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #334155;
    font-size: 0.9rem;
    letter-spacing: 0.2px;
}

/* BOUTONS */
.btn {
    padding: 12px 28px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.2s;
    font-family: 'Inter', sans-serif;
    display: inline-block;
}

.btn-primary {
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
    color: #fff;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    color: #fff;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

.btn-danger:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(220, 38, 38, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #fff;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-success:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

/* TABLEAU */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

thead {
    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
    color: #fff;
}

thead th {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
}

th, td {
    padding: 16px 18px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
    font-size: 0.9rem;
}

th:first-child {
    border-radius: 10px 0 0 0;
}

th:last-child {
    border-radius: 0 10px 0 0;
}

tr:hover {
    background-color: #f8fafc;
}

tbody tr {
    transition: background 0.2s;
}

/* ALERTES */
.alert {
    padding: 16px 20px;
    border-radius: 12px;
    margin-bottom: 25px;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-success {
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #6ee7b7;
}

.alert-success::before {
    content: '✓';
    font-weight: bold;
    font-size: 1.2rem;
}

.alert-error {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.alert-error::before {
    content: '⚠';
    font-weight: bold;
    font-size: 1.2rem;
}

/* LOGIN */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 50%, #60a5fa 100%);
    position: relative;
    overflow: hidden;
}

.login-wrapper::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    top: -200px;
    right: -200px;
    border-radius: 50%;
}

.login-box {
    background: #fff;
    padding: 50px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    width: 100%;
    max-width: 440px;
    position: relative;
    z-index: 1;
}

.login-box h1 {
    text-align: center;
    color: #1e293b;
    margin-bottom: 35px;
    font-size: 1.8rem;
    font-family: 'Playfair Display', serif;
    font-weight: 700;
}

/* PHOTO CANDIDATE */
.candidate-photo {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #e2e8f0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* CLASSEMENT */
.classement-item {
    display: flex;
    align-items: center;
    padding: 20px 25px;
    border-radius: 14px;
    margin-bottom: 15px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    border: 1px solid #e2e8f0;
    transition: all 0.3s;
}

.classement-item:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

.classement-item .rang {
    font-size: 1.6rem;
    font-weight: 700;
    color: #2563eb;
    width: 60px;
    font-family: 'Playfair Display', serif;
}

.classement-item.rang-1 {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-color: #fbbf24;
}
.classement-item.rang-1 .rang { color: #d97706; }

.classement-item.rang-2 {
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    border-color: #94a3b8;
}
.classement-item.rang-2 .rang { color: #475569; }

.classement-item.rang-3 {
    background: linear-gradient(135deg, #fed7aa 0%, #fdba74 100%);
    border-color: #f97316;
}
.classement-item.rang-3 .rang { color: #c2410c; }

.classement-item .points {
    margin-left: auto;
    font-weight: 700;
    color: #1e293b;
    font-size: 1.3rem;
}

/* NOTATION - DRAG OR SELECT */
.candidate-row {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 18px 20px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    margin-bottom: 15px;
    background: #fff;
    transition: all 0.2s;
}

.candidate-row:hover {
    border-color: #2563eb;
    background: #f8fafc;
}

.candidate-row img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #e2e8f0;
}

.candidate-row select {
    width: auto;
    margin-bottom: 0;
    min-width: 250px;
}

/* BADGE ROLE */
.badge {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-block;
}

.badge-admin { 
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.badge-gestionnaire { 
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #92400e;
    border: 1px solid #fbbf24;
}

.badge-jury { 
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    color: #065f46;
    border: 1px solid #6ee7b7;
}

/* RESPONSIVE */
@media (max-width: 600px) {
    nav { flex-direction: column; gap: 10px; }
    .candidate-row { flex-direction: column; align-items: flex-start; }
}
