body {
    font-family: sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f4f4f4;
    color: #333;
}

.films-grid {
    display: grid; 
    grid-template-columns: repeat(3, 250px);
    justify-content: center; 
    gap: 20px; 
    padding: 20px;
}

.filmCard { 
    width: 250px;
    height: 350px; 
    position: relative; 
    overflow: hidden; 
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); 
    border-radius: 8px; 
    transition: transform 0.3s; 
    width: calc((100% / 3) - (2 * 20px / 3));
    width: 250px;
    height: 350px; 
    position: relative;
}

.filmCard:hover { 
    transform: translateY(-5px); 
}

.filmCard img { 
    width: 100%; 
    height: 100%; 
    object-fit: cover; 
    display: block; 
    transition: filter 0.3s; 
}

.film-card.a-venir img { 
    filter: grayscale(80%) opacity(0.5);
}

.card { 
    position: absolute; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    display: flex; 
    flex-direction: column; 
    justify-content: center; 
    align-items: center; 
    background-color: rgba(0, 0, 0, 0.6); 
    color: white; 
    opacity: 0; 
    transition: opacity 0.3s; 
    text-decoration: none; 
}

.filmCard.projete:hover .card { 
    opacity: 1; 
}

.vote-link span {
    font-size: 24px; 
    font-weight: bold; 
    color: white;
}

.info-link { 
    background-color: rgba(0, 0, 0, 0.8);
    opacity: 1 !important; 
    pointer-events: none; 
}

.info-link .status { 
    font-size: 20px; 
    margin-bottom: 10px; 
}

.info-link .info-btn { 
    pointer-events: auto; 
    color: white; 
    padding: 5px 10px; 
    border: 1px solid white; 
    border-radius: 4px; 
    text-decoration: none; 
}


@media screen and (max-width: 1023px) {
   .films-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 20px 10px;
    }

    .filmCard {
        width: 90%;
        height: 1200px;
        justify-self: center;
    }

    .vote-link span {
        font-size: 60px; 
    }

    .info-link .status { 
        font-size: 100px;
        margin-bottom: 15px;
    }

    .info-link .info-btn { 
        padding: 10px 18px;
        font-size: 60px;
    }
}



/* Admin connexion */

.login-container {
    background-color: #ffffff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 380px; 
    text-align: center;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.login-container h2 {
    color: #343a40;
    margin-bottom: 25px;
    font-size: 1.8em;
    border-bottom: 2px solid #ca0c0f;
    display: inline-block;
    padding-bottom: 5px;
}

.login-container form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.login-container input[type="text"],
.login-container input[type="password"] {
    width: 100%;
    padding: 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    box-sizing: border-box;
    font-size: 1em;
    transition: border-color 0.3s;
}

.login-container input:focus {
    border-color: #ca0c0f;
    outline: none;
    box-shadow: 0 0 5px rgba(0, 123, 255, 0.25);
}

.login-container button[type="submit"] {
    background-color: #ca0c0f;
    color: white;
    padding: 12px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1.1em;
    font-weight: bold;
    transition: background-color 0.3s, transform 0.2s;
}

.login-container button[type="submit"]:hover {
    background-color: #ca0c0f;
    transform: translateY(-1px);
}

.login-container p {
    margin-top: -10px;
    margin-bottom: 15px;
    font-weight: bold;
    color: #dc3545; 
}

@media (max-width: 1023px) {
    .login-container {
        max-width: 80%; 
        padding: 40px 30px;
    }

    .login-container h2 {
        font-size: 2em;
    }

    .login-container input[type="text"], .login-container input[type="password"], .login-container button[type="submit"] {
        padding: 25px 15px; 
        font-size: 2.5em;
    }

    .login-container form {
        gap: 30px; 
    }
}


.admin-container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 20px;
    background: white;
    box-shadow: 0 0 20px rgba(0,0,0,0.1);
    border-radius: 8px;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #ca0c0f;
    padding-bottom: 20px;
    margin-bottom: 30px;
}

.admin-actions .btn {
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 5px;
    font-weight: bold;
    margin-left: 10px;
    transition: 0.3s;
}

.btn-export {
    background-color: #27ae60;
    color: white;
}
.btn-export:hover { background-color: #219150; }

.btn-logout {
    background-color: #333;
    color: white;
}
.btn-logout:hover { background-color: #555; }

.charts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 50px;
}

@media (max-width: 768px) {
    .charts-grid { grid-template-columns: 1fr; }
}

.chart-box {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #eee;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.data-table th, .data-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.data-table th {
    background-color: #f4f4f4;
    font-weight: bold;
    color: #333;
}

.data-table tr:hover {
    background-color: #f1f1f1;
}

.note-badge {
    display: inline-block;
    padding: 5px 10px;
    background-color: #ca0c0f;
    color: white;
    border-radius: 15px;
    font-weight: bold;
    font-size: 0.9em;
}


/* --- Media Query pour tablettes et petits écrans (max 1023px) --- */
@media screen and (max-width: 1023px) {
    h2{
        font-size: 40px;
    }

    h3{
        font-size: 30px;
    }

    .admin-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .admin-actions {
        flex-direction: row; 
        width: 100%; 
    }

    .admin-actions .btn {
        padding: 15px 40px;
        font-size: 1.2em;
    }

    .charts-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .chart-box {
        padding: 15px;
    }

    .data-table {
        font-size: 1.6em;
        width: 100%;
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    .data-table th, 
    .data-table td {
        padding-top: 40px;
        padding-bottom: 40px;
        padding-left: 10px;
        padding-right: 10px;
        vertical-align: middle;
    }
    
    .data-table td:nth-child(4) { 
        min-width: 150px; 
        max-width: 200px;
        box-sizing: border-box;
    }

    .data-table td:nth-child(2) {
        text-align: center;
    }
    
}