:root {
    --primary-color: #63003C;
    --primary-dark: #4E0030;
    --primary-light: #7A0049;
    --secondary-color: #f3f4f6;
    --text-color: #1e293b;
    --error-color: #ef4444;
    --warning-color: #f59e0b;
    --success-color: #10b981;
    --background-gradient: linear-gradient(135deg, #F8E5EF, #F9E9F1, #F7E3ED, #F6E0EA);
}

@keyframes gradientAnimation {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes shimmer {
    0% { background-position: -1000px 0; }
    100% { background-position: 1000px 0; }
}

body {
    font-family: 'Open Sans', sans-serif;
    font-weight: 600;
    line-height: 1.6;
    color: var(--text-color);
    margin: 0;
    padding: 0;
    background: var(--background-gradient);
    background-size: 400% 400%;
    animation: gradientAnimation 15s ease infinite;
    min-height: 100vh;
    
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px;
}

header {
    background: linear-gradient(135deg, #4E0030, #7A0049, #63003C);
    color: white;
    padding: 30px 0;
    text-align: center;
    box-shadow: 0 4px 20px rgba(99, 0, 60, 0.3);
    border-radius: 0 0 20px 20px;
    margin-bottom: 40px;
    position: relative;
    overflow: hidden;
}

header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, rgba(255,255,255,0.1) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.1) 50%, rgba(255,255,255,0.1) 75%, transparent 75%, transparent);
    background-size: 20px 20px;
    z-index: 1;
}

h1 {
    margin: 0;
    font-size: 32px;
    position: relative;
    z-index: 2;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
    font-family: 'Open Sans', sans-serif;
    font-weight: 600;
}

.search-box {
    background: #F9F9F9;
    border-radius: 20px;
    padding: 35px;
    margin: 30px 0;
    box-shadow: 0 10px 30px rgba(99, 0, 60, 0.15);
    animation: fadeIn 0.8s ease-out;
    border: 2px solid #63003C;
    backdrop-filter: blur(10px);
    transition: transform 0.3s, box-shadow 0.3s;
}

.search-box:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(99, 0, 60, 0.2);
}

.form-group {
    margin-bottom: 25px;
}

label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: #63003C;
    letter-spacing: 0.5px;
    font-family: 'Open Sans', sans-serif;
}

input[type="text"] {
    width: 100%;
    padding: 15px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    box-sizing: border-box;
    font-size: 16px;
    transition: all 0.3s;
    background: linear-gradient(to right, rgba(248, 229, 239, 0.1), rgba(249, 233, 241, 0.3));
    font-family: 'Open Sans', sans-serif;
}

input[type="text"]:focus {
    border-color: var(--primary-light);
    outline: none;
    box-shadow: 0 0 0 3px rgba(99, 0, 60, 0.3);
}

button {
    background: linear-gradient(to right, #63003C, #7A0049);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.5px;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(99, 0, 60, 0.25);
    position: relative;
    overflow: hidden;
    font-family: 'Open Sans', sans-serif;
}

button::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(to right, transparent, rgba(255,255,255,0.2), transparent);
    transition: all 0.5s;
}

button:hover {
    background: linear-gradient(to right, #4E0030, #63003C);
    box-shadow: 0 6px 16px rgba(99, 0, 60, 0.35);
    transform: translateY(-2px);
}

button:hover::after {
    left: 100%;
}

.loading {
    text-align: center;
    margin: 40px 0;
    display: none;
    animation: pulse 1.5s infinite;
}

.loading::after {
    content: '';
    display: block;
    width: 50px;
    height: 50px;
    margin: 20px auto;
    border-radius: 50%;
    border: 6px solid #F8E5EF;
    border-top-color: #63003C;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.result {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 20px;
    padding: 30px;
    margin-top: 40px;
    box-shadow: 0 10px 30px rgba(99, 0, 60, 0.15);
    display: none;
    animation: fadeIn 0.8s ease-out;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(99, 0, 60, 0.1);
}

.student-info {
    background: linear-gradient(to right, #F9E9F1, #F8E5EF);
    padding: 25px;
    border-radius: 15px;
    margin-bottom: 30px;
    box-shadow: 0 5px 15px rgba(99, 0, 60, 0.1);
    border-left: 5px solid #63003C;
}

.summary {
    display: flex;
    justify-content: space-between;
    margin: 30px 0;
    text-align: center;
    flex-wrap: wrap;
    gap: 15px;
}

.summary-item {
    flex: 1;
    padding: 20px;
    border-radius: 15px;
    margin: 0;
    min-width: 200px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.summary-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255,255,255,0.2) 0%, rgba(255,255,255,0) 100%);
}

.summary-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 25px rgba(0,0,0,0.15);
}

.absence {
    background: linear-gradient(to right, #dc2626, #ef4444);
    color: white;
}

.retard {
    background: linear-gradient(to right, #d97706, #f59e0b);
    color: white;
}

.exclusion {
    background: linear-gradient(to right, #b91c1c, #dc2626);
    color: white;
}

.details {
    margin-top: 40px;
}

.tabs {
    display: flex;
    border-bottom: 2px solid #e2e8f0;
    margin-bottom: 30px;
    gap: 5px;
}

.tab {
    padding: 12px 25px;
    cursor: pointer;
    border-radius: 10px 10px 0 0;
    transition: all 0.3s;
    font-weight: 500;
    background: #f8fafc;
    position: relative;
    z-index: 1;
    border: 2px solid #e2e8f0;
    border-bottom: none;
    font-family: 'Open Sans', sans-serif;
}

.tab.active {
    background: linear-gradient(to bottom, #F9E9F1, white);
    font-weight: bold;
    color: #63003C;
    border-color: #63003C;
    box-shadow: 0 -5px 15px rgba(99, 0, 60, 0.1);
    z-index: 2;
}

.tab:hover:not(.active) {
    background: #f1f5f9;
    color: #63003C;
}

.tab-content {
    display: none;
    animation: fadeIn 0.5s ease-out;
}

.tab-content.active {
    display: block;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

th, td {
    padding: 15px;
    text-align: left;
    font-family: 'Open Sans', sans-serif;
}

thead {
    background: linear-gradient(to right, #F8E5EF, #F9E9F1);
}

th {
    font-weight: 600;
    color: #63003C;
    position: relative;
}

th:not(:last-child)::after {
    content: '';
    position: absolute;
    right: 0;
    top: 25%;
    height: 50%;
    width: 1px;
    background-color: #F8E5EF;
}

tbody tr {
    background-color: white;
    transition: all 0.2s;
}

tbody tr:nth-child(even) {
    background-color: #f8fafc;
}

tbody tr:hover {
    background-color: #F9E9F1;
    transform: scale(1.01);
    box-shadow: 0 5px 15px rgba(99, 0, 60, 0.1);
    z-index: 1;
    position: relative;
}

td {
    border-bottom: 1px solid #e2e8f0;
}

tbody tr:last-child td {
    border-bottom: none;
}

.justifiee {
    color: #10b981;
    font-weight: bold;
    position: relative;
    padding-left: 20px;
}

.justifiee::before {
    content: '✓';
    position: absolute;
    left: 0;
}

.non-justifiee {
    color: #ef4444;
    font-weight: bold;
    position: relative;
    padding-left: 20px;
}

.non-justifiee::before {
    content: '✕';
    position: absolute;
    left: 0;
}

.error-message {
    color: white;
    background: linear-gradient(to right, #4E0030, #63003C);
    padding: 20px;
    border-radius: 10px;
    margin: 30px 0;
    display: none;
    animation: fadeIn 0.5s ease-out;
    box-shadow: 0 8px 15px rgba(99, 0, 60, 0.25);
    position: relative;
    overflow: hidden;
}

.error-message::before {
    content: '⚠️';
    font-size: 24px;
    margin-right: 10px;
    display: inline-block;
}

h2, h3 {
    color: #63003C;
    margin-top: 0;
    position: relative;
    padding-bottom: 10px;
    font-family: 'Open Sans', sans-serif;
    font-weight: 600;
}

h2::after, h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 3px;
    background: linear-gradient(to right, #63003C, #7A0049);
    border-radius: 3px;
}

h4 {
    color: #63003C;
    margin-top: 0;
    position: relative;
    padding-bottom: 10px;
    font-family: 'Open Sans', sans-serif;
    font-weight: 600;
}

h4::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    background: linear-gradient(to right, #63003C, #7A0049);
    border-radius: 3px;
}

/* Animations pour les chiffres */
.count-animation {
    font-size: 30px;
    font-weight: bold;
    margin: 10px 0;
    animation: pulse 2s infinite;
}

/* Glassmorphism effects */
.glass-effect {
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.2);
}

/* Amélioration des animations */
@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-8px); }
    100% { transform: translateY(0px); }
}

.float-animation {
    animation: float 5s ease-in-out infinite;
}

:root {
    --primary-color: #63003C;
    --primary-dark: #4E0030;
    --primary-light: #7A0049;
    --secondary-color: #f3f4f6;
    --text-color: #1e293b;
    --error-color: #ef4444;
    --warning-color: #f59e0b;
    --success-color: #10b981;
    --background-gradient: linear-gradient(135deg, #F8E5EF, #F9E9F1, #F7E3ED, #F6E0EA);
}

@media screen and (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    header {
        padding: 20px 0;
        margin-bottom: 20px;
    }
    
    h1 {
        font-size: 24px;
    }
    
    .search-box {
        padding: 20px;
        margin: 15px 0;
    }
    
    .form-group {
        margin-bottom: 15px;
    }
    
    input[type="text"] {
        padding: 12px;
        font-size: 14px;
    }
    
    button {
        padding: 12px 20px;
        font-size: 14px;
        width: 100%;
    }
    
    .result {
        padding: 20px;
        margin-top: 20px;
    }
    
    .student-info {
        padding: 15px;
    }
    
    .summary {
        flex-direction: column;
        gap: 10px;
    }
    
    .summary-item {
        min-width: 100%;
        padding: 15px;
    }
    
    .count-animation {
        font-size: 24px;
    }
    
    .tabs {
        flex-wrap: wrap;
        gap: 2px;
    }
    
    .tab {
        padding: 8px 15px;
        font-size: 14px;
        flex-grow: 1;
        text-align: center;
    }
    
    table {
        display: block;
        overflow-x: auto;
    }
    
    th, td {
        padding: 10px;
        font-size: 14px;
        white-space: nowrap;
    }
    
    .error-message {
        padding: 15px;
        margin: 15px 0;
    }
    
    h2, h3, h4 {
        font-size: 18px;
    }
    
    .loading::after {
        width: 40px;
        height: 40px;
    }
}

@media screen and (max-width: 480px) {
    h1 {
        font-size: 20px;
    }
    
    .search-box {
        padding: 15px;
    }
    
    .tab {
        padding: 6px 10px;
        font-size: 13px;
    }
    
    th {
        font-size: 13px;
    }
    
    td {
        font-size: 13px;
    }
    
    .student-info {
        padding: 12px;
        margin-bottom: 15px;
    }
    
    .count-animation {
        font-size: 22px;
        margin: 5px 0;
    }
    
    .details {
        margin-top: 20px;
    }
    
    .summary-item {
        padding: 12px;
    }
}

@media screen and (max-height: 500px) and (orientation: landscape) {
    .container {
        padding: 5px 10px;
    }
    
    header {
        padding: 15px 0;
        margin-bottom: 15px;
    }
    
    .search-box {
        padding: 15px;
        margin: 10px 0;
    }
    
    .summary {
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .summary-item {
        min-width: calc(33.33% - 10px);
    }
    
    th, td {
        padding: 8px;
    }
}

@media screen and (max-width: 768px) {
    input[type="text"]:focus {
        font-size: 16px;
    }
    
    label {
        font-size: 14px;
    }
    
    .tab, button {
        min-height: 44px;
    }
}

@media print {
    body {
        background: none;
        color: black;
    }
    
    .search-box, .loading, button, .tabs {
        display: none;
    }
    
    .result {
        display: block !important;
        box-shadow: none;
        border: 1px solid #ccc;
    }
    
    .summary-item {
        border: 1px solid #ccc;
        color: black !important;
        background: none !important;
    }
    
    header {
        background: none;
        color: black;
        box-shadow: none;
    }
    
    h1, h2, h3, h4 {
        color: black;
    }
    
    table {
        box-shadow: none;
        border: 1px solid #ccc;
    }
    
    th, td {
        border-bottom: 1px solid #ccc;
    }
}


.header-btn {
    margin-top: 15px;
    background: white;
    color: #63003C;
    border: 2px solid #63003C;
    padding: 12px 25px;
    border-radius: 8px;
    font-weight: bold;
    font-family: 'Open Sans', sans-serif;
    transition: all 0.3s ease;
    cursor: pointer;
    font-size: 16px;
    display: block;              /* <-- important pour centrer */
    text-align: center;
    text-decoration: none;
    width: fit-content;
    margin-left: auto;           /* <-- centrer */
    margin-right: auto;          /* <-- centrer */
    box-shadow: 0 4px 20px rgba(99, 0, 60, 0.3);
    position: relative;
}

.header-btn:hover {
    background: #63003C;
    color: white;
    box-shadow: 0 4px 20px rgba(99, 0, 60, 0.3);
    transform: translateY(-2px);
    transition: all 0.3s ease;
    text-decoration: none;
    text-align: center;
    width: fit-content;
    margin-left: auto;           /* <-- centrer */
    margin-right: auto;          /* <-- centrer */

        
}