/* === RESET & BASE === */
*, *::before, *::after { box-sizing: border-box; }
html, body { max-width: 100vw; overflow-x: hidden; }
body {
    background: #121212;
    color: #ddd;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    margin: 0; padding: 0; min-height: 100vh;
    display: flex; flex-direction: column;
}
a { color: #0a7a0a; text-decoration: none; transition: color 0.2s; }
a:hover { color: #065806; text-decoration: underline; }
button, input, select, textarea {
    font-size: 1rem; border-radius: 4px; outline: none;
}
button {
    background: #0a7a0a; border: none; color: #fff;
    padding: 8px 15px; cursor: pointer; transition: background 0.2s;  margin: 3px;
}
button:hover { background: #065806; }
input, select, textarea {
    background: #222; color: #eee; border: 1px solid #444; padding: 8px;
    transition: border-color 0.2s;
}
input:focus, select:focus, textarea:focus { border-color: #0a7a0a; }

/* === SCROLLBAR === */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: #0a7a0a; border-radius: 10px; border: 3px solid #121212;
}

/* === CONTAINER === */
.container {
    max-width: 1200px; margin: 0 auto; padding: 20px; flex-grow: 1; width: 100%;
}

/* === HEADER === */
header {
    background: #101010; padding: 15px 20px; border-bottom: 2px solid #0a7a0a;
    display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 15px;
}
header .logo-container { display: flex; align-items: center; }
header .logo-container img { height: 60px; width: auto; }
header nav { display: flex; align-items: center; gap: 15px; }
header nav a { font-weight: 600; white-space: nowrap; }
header nav a.active { color: #fff; text-decoration: underline; }
#searchInput { flex-grow: 1; min-width: 120px; max-width: 250px; }

/* === FOOTER === */
footer {
    margin-top: 50px; padding: 20px; text-align: center; font-size: 0.9rem;
    color: #666; border-top: 1px solid #0a7a0a; background: #101010; width: 100%;
}

/* === CONTENT CARDS (Accueil) === */
.content-list {
    margin-top: 30px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    justify-items: center;
    align-items: start;
    width: 100%;
    max-width: 1600px;
    margin-left: auto;
    margin-right: auto;
}

.content-card {
    width: 100%;
    max-width: 400px;
    background: #181818;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.25);
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
    display: block;
    color: inherit;
    text-decoration: none;
    aspect-ratio: 16/9;
}

.content-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(10,122,10,0.3);
}

.content-card img, 
.content-card video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    background: #181818;
    transition: transform 0.3s ease;
}

.content-card:hover img, 
.content-card:hover video {
    transform: scale(1.05);
}



.card-overlay {
    position: absolute; 
    left: 0; 
    right: 0; 
    bottom: 0;
    background: linear-gradient(0deg,rgba(0,0,0,0.82) 70%,rgba(0,0,0,0.05) 100%);
    color: #fff; 
    padding: 10px 12px 8px 12px; 
    width: 100%; 
    z-index: 2; 
    gap: 2px;
    transition: opacity 0.3s ease;
} 



.card-title {
    color: white;
    font-size: 1.1em;
    font-weight: 500;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-category {
    color: #0a7a0a;
    font-size: 0.9em;
    font-weight: 500;
}

.content-card:hover .card-overlay {
    opacity: 0;
}

/* Ajustements responsifs pour l'overlay */
@media (max-width: 768px) {
    .card-overlay {
        padding: 10px;
    }
    
    .card-title {
        font-size: 1em;
    }
    
    .card-category {
        font-size: 0.8em;
    }
}

/* === FILTRES & TRI === */
.filters-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
    justify-content: flex-start;
}
.sort-group {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.sort-inline-group {
    display: flex;
    align-items: center;
    gap: 4px;
}
.filters-label { color: #b6ffb6; font-weight: 500; font-size: 1em; margin-right: 4px; }
.categories-list { display: flex; gap: 7px; flex-wrap: wrap; }
.category-btn {
    background: #232323; color: #b6ffb6; border: 1.5px solid #0a7a0a;
    border-radius: 7px; padding: 7px 14px; font-size: 1em; font-weight: 500;
    cursor: pointer; transition: background 0.18s, color 0.18s, border-color 0.18s;
}
.category-btn.active, .category-btn:hover {
    background: #0a7a0a; color: #fff; border-color: #0a7a0a;
}
.sort-group { display: flex; align-items: center; gap: 10px; margin-left: 18px; }
#sortSelect { font-size: 1em; padding: 7px 10px; min-width: 110px; }
#resetFiltersBtn {
    background: #444;
    color: #fff;
    border: none;
    border-radius: 32px;
    min-width: 32px;
    height: 32px;
    font-size: 1.1em;
    padding: 0 10px;
    margin-left: 8px;
    cursor: pointer;
    margin-left: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 18px;
    transition: background 0.18s, color 0.18s, border-color 0.18s, transform 0.12s;
}
#resetFiltersBtn:hover {
    background: #0a7a0a;
    color: #fff;
}

/* === FORMULAIRES (Publication/Admin) === */
form.upload-form, #loginForm {
    background: #1a1a1a; border: 1px solid #0a7a0a; border-radius: 8px;
    padding: 20px; margin: 20px auto 0 auto; max-width: 600px;
}
form.upload-form label, #loginForm label { display: block; margin-bottom: 8px; font-weight: 600; color: #0a7a0a; }
form.upload-form input[type="text"], form.upload-form select, form.upload-form input[type="file"] { width: 100%; margin-bottom: 15px; }
#uploadMessage, #message { margin-top: 15px; text-align: center; font-weight: bold; color: #f55; }
#loginForm { max-width: 300px; margin: 50px auto 20px; box-shadow: 0 0 10px rgba(0, 122, 0, 0.3); }
#loginForm input, #loginForm button { width: 100%; margin: 8px 0; }
#logoutBtn, button[data-action="delete"] {
    background: #d9534f;
}
#logoutBtn:hover, button[data-action="delete"]:hover {
    background: #c9302c;
}
.editInput { width: 100%; padding: 5px; background: #222; color: #eee; border: 1px solid #555; border-radius: 4px; }
#adminSearchInput {
    background: #232323; color: #eee; border: 1.5px solid #0a7a0a; border-radius: 7px;
    padding: 10px 14px; font-size: 1em; margin: 10px 0 12px 0; width: 100%; max-width: 400px;
}
#adminSearchInput:focus { border-color: #b6ffb6; }
#addCategoryBtn {
    background: #4d4d4d; color: #fff; border: none; padding: 10px 15px; border-radius: 8px; cursor: pointer; margin-bottom: 10px;
}
#addCategoryBtn:disabled { cursor: not-allowed; opacity: 0.3; }
#categoryAdminSection {
    background: #181818; border-radius: 8px; padding: 18px; margin-top: 40px; max-width: 500px;
}
#adminCategoryList { list-style: none; padding: 0; margin-bottom: 15px; }
#adminCategoryList li { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
#adminCategoryList .cat-name { flex: 1; }
#adminCategoryList button, .delete-cat-btn {
    padding: 6px 12px; font-size: 0.95em; border-radius: 6px; background: #d9534f; color: #fff; border: none; cursor: pointer;
}
.delete-cat-btn:hover { background: #c9302c; }

/* === PAGE DE DÉTAIL (content.html) === */
.back-link {
    display: block; width: fit-content; margin: 20px auto; color: #007bff;
    text-decoration: none; font-weight: bold; transition: color 0.3s;
}
.back-link:hover { color: #66b3ff; text-decoration: underline; }
.detail-content-wrapper {
    max-width: 1400px;
    margin: 20px auto;
    background: #1a1a1a;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    overflow: hidden;
}

.content-detail-card {
    display: grid;
    grid-template-columns: 70% 30%;
    gap: 0;
    min-height: 90vh;
}

/* Zone média principale */
.media-section {
    padding: 20px;
    background: #141414;
}

.media-display {
    width: 100%;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    aspect-ratio: 16/9;
}

.media-display.vertical {
    aspect-ratio: 9/16;
    max-width: 56.25vh;
    margin: 0 auto;
}

.media-display video,
.media-display img {
    width: 100%;
    height: 100%;
    object-fit: scale-down;
    max-height: 90vh;
}

/* Informations et interactions */
.content-info {
    padding: 20px;
    background: #1a1a1a;
    border-left: 1px solid #2a2a2a;
    flex-direction: column;
    gap: 20px;
}

.title-detail {
    font-size: 1.8em;
    color: #fff;
    margin: 0;
    line-height: 1.3;
}

.metadata {
    display: flex;
    align-items: center;
    gap: 15px;
    color: #aaa;
    font-size: 0.9em;
}

.category-badge {
    display: inline-block;
    background: #272727;
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.9em;
    margin-top: 10px;
}

/* Zone d'interaction */
.interaction-zone {
    display: flex;
    flex-direction: column;
    gap: 1px;
    margin-top: 10px;
    padding-top: 10px;
}

.button-container {
    display: flex;
    gap: 10px;
}

.action-button {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    background: #232323;
    border: none;
    border-radius: 8px;
    color: #fff;
    transition: all 0.2s ease;
}

.action-button:hover {
    background: #2a2a2a;
}

.action-button.active {
    background: #0a7a0a;
}

/* Zone des commentaires */
.comments-section {
    margin-top: 30px;
    padding: 20px 0;
    border-top: 1px solid #2a2a2a;
}

.comments-section h2 {
    font-size: 1.2em;
    color: #ffffff;
    margin-bottom: 20px;
}

.comment-date {
    color: #868686;
}

#commentForm {
    margin-bottom: 25px;
}

#commentInput {
    width: 100%;
    min-height: 80px;
    padding: 12px;
    background: #232323;
    border: 1px solid #333;
    border-radius: 8px;
    color: #ffffff;
    margin-bottom: 10px;
}

.comment {
    background: #232323;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
}

/* Navigation entre contenus */
.nav-btns-row {
    padding: 15px 20px;
    background: #141414;
    border-top: 1px solid #2a2a2a;
    margin-top: 15px;
    display: flex;
    justify-content: space-between;
    position: relative;
    width: 100%;
}

#prevContentBtn {
    position: absolute;
    left: 20px;
}

#nextContentBtn {
    position: absolute;
    right: 20px;
}

#prevContentBtn, #nextContentBtn {
    background: #232323;
    border: none;
    padding: 8px 15px;
    border-radius: 6px;
    color: #fff;
    transition: all 0.2s ease;
}

/* === RECOMMENDATIONS === */
.recommendations-section {
    margin-top: 40px;
    padding: 20px;
    background: #1a1a1a;
    border-radius: 12px;
}

.recommendations-section h2 {
    color: #fff;
    font-size: 1.4em;
    margin-bottom: 20px;
}

.recommendations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.recommendation-card {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 16/9;
    transition: transform 0.3s ease;
}

.recommendation-card:hover {
    transform: translateY(-5px);
}

.recommendation-card img,
.recommendation-card video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.recommendation-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 10px;
    background: linear-gradient(0deg, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0) 100%);
    color: white;
}

.recommendation-title {
    font-size: 0.9em;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.recommendation-metadata {
    font-size: 0.8em;
    color: #aaa;
}

@media (max-width: 768px) {
    .recommendations-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 15px;
    }
}

/* Responsive */
@media (max-width: 1024px) {
    .content-detail-card {
        grid-template-columns: 1fr;
    }
    
    .content-info {
        border-left: none;
        border-top: 1px solid #2a2a2a;
    }
}

@media (max-width: 768px) {
    .detail-content-wrapper {
        margin: 0;
        border-radius: 0;
    }
    
    .media-section {
        padding: 10px;
    }
    
    .content-info {
        padding: 15px;
    }
    
    .title-detail {
        font-size: 1.4em;
    }
    
    .button-container {
        flex-direction: column;
    }
}

@media (max-width: 900px) {
    .container, .detail-content-wrapper { padding: 2vw; max-width: 100vw; }
    header { flex-direction: row; align-items: center; gap: 0; padding: 10px 2vw; }
    header .logo-container img { height: 34px; }
    header nav { margin-left: auto; gap: 8px; }
    #searchInput { min-width: 70px; width: 90px; max-width: 120px; }
    .content-list { grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
    .content-card { min-width: 0; min-height: 120px; border-radius: 10px; }
    .content-card img, .content-card video { border-radius: 10px; object-fit: cover; }
    .card-overlay { padding: 8px 7px 7px 7px; font-size: 1em; }
    .detail-content-wrapper { gap: 10px; }
    .media-display { min-height: 120px; border-radius: 8px; }
    .content-info { padding: 8px; border-radius: 8px; }
    .content-info .title-detail { font-size: 1.1em; }
    .video-info-bar { flex-direction: column; align-items: flex-start; gap: 6px; padding-bottom: 6px; margin-bottom: 8px; }
    .comments-section { padding: 8px 2px; border-radius: 8px; margin-top: 12px; }
    #commentInput { font-size: 1em; padding: 7px; border-radius: 7px; }
    #commentForm button { padding: 7px 14px; font-size: 1em; border-radius: 7px; }
    .comment { padding: 8px 8px; border-radius: 7px; font-size: 1em; }
    .back-link { margin: 10px auto; font-size: 1em; }
    #pagination button { padding: 8px 12px; font-size: 1em; border-radius: 7px; margin: 2px; }
    .dropdown-content { right: 0; left: auto; min-width: 140px; max-height: 220px; font-size: 1em; }
    .button-container { flex-direction: column; width: 100%; max-width: 250px; padding: 10px; gap: 10px; align-items: stretch; }
    .action-button { width: 100%; padding: 12px 0; font-size: 1em; border-radius: 12px; justify-content: flex-start; }
    .action-button i { margin-right: 10px; font-size: 1.1em; }
    .button-separator { width: 80%; height: 1.5px; margin: 8px auto; display: block; }
}
@media (max-width: 700px) {
    .filters-bar {
        flex-direction: row;      /* <-- reste en ligne */
        align-items: center;      /* <-- centré verticalement */
        gap: 8px;
        margin-bottom: 10px;
    }
    .sort-group {
        flex-direction: row;      /* <-- reste en ligne */
        align-items: center;
        gap: 8px;
        flex-wrap: wrap;
    }
    .sort-inline-group {
        flex-direction: row;
        align-items: center;
        gap: 4px;
    }
    .sort-group label {
        margin-bottom: 0;
        margin-right: 2px;
    }
    #categorySelect,
    #sortSelect {
        width: auto;
        min-width: 90px;
        font-size: 1em;
        margin-bottom: 0;
    }
    #resetFiltersBtn {
        min-width: 28px;
        height: 28px;
        font-size: 1em;
        padding: 0 8px;
        margin-left: 6px;
    }
}
@media (max-width: 600px) {
    .container, .detail-content-wrapper { padding: 1vw; gap: 6px; }
    .content-list { grid-template-columns: 1fr; gap: 8px; }
    .content-card { min-height: 90px; border-radius: 8px; }
    .content-card img, .content-card video { border-radius: 8px; }
    .card-overlay { padding: 6px 5px 5px 5px; font-size: 0.97em; }
    .media-display { min-height: 70px; border-radius: 6px; }
    .content-info { padding: 5px; border-radius: 6px; }
    .comments-section { padding: 6px 1px; border-radius: 6px; margin-top: 8px; }
    .comment { padding: 6px 6px; border-radius: 5px; font-size: 0.97em; }
    #pagination button { padding: 6px 8px; font-size: 0.97em; border-radius: 5px; }
    header .logo-container img { height: 28px; }
    #searchInput { min-width: 90px; width: 90px; max-width: 100px; font-size: 0.95em; }
    #loginForm { max-width: 98vw; padding: 12px; border-radius: 7px; font-size: 1em; }
    #loginForm input, #loginForm button { font-size: 1em; padding: 10px; margin: 6px 0; }
    #categoryAdminSection { max-width: 100vw; padding: 10px 4px; margin-top: 18px; border-radius: 7px; }
    #adminCategoryList li { flex-direction: column; align-items: flex-start; gap: 4px; }
    #adminNewCategory, #adminAddCategoryBtn { width: 100%; margin-bottom: 8px; font-size: 1em; }
}
@media (max-width: 480px) {
    .button-container { flex-direction: row; max-width: 40vw; padding: 2px 0; gap: 4px; align-items: center; }
    .action-button { width: auto; max-width: 64px; padding: 6px 6px; font-size: 0.95em; border-radius: 10px; margin: 0 2px; }
    .action-button i { margin-right: 4px; font-size: 0.95em; }
    .button-separator { width: 1px; height: 22px; margin: 0 2px; }
}
#prevContentBtn, #nextContentBtn {
    background: #232323;
    color: #b6ffb6;
    border: 1.5px solid #0a7a0a;
    border-radius: 7px;
    padding: 8px 18px;
    font-size: 1em;
    font-weight: 1;
    cursor: pointer;
    transition: background 0.18s, color 0.18s, border-color 0.18s, transform 0.12s;
}
#prevContentBtn:hover, #nextContentBtn:hover {
    background: #0a7a0a;
    color: #fff;
    border-color: #0a7a0a;
    transform: scale(1.03);
}
.nav-btns-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    gap: 10px;
}
/* === ANIMATIONS === */
@keyframes pop-yt {
    0% { transform: scale(1); }
    50% { transform: scale(1.5) rotate(-10deg); }
    70% { transform: scale(1.2) rotate(5deg);}
    100% { transform: scale(1) rotate(0);}
}
.like-anim {
    animation: pop-yt 0.32s cubic-bezier(.4,2,.6,1) both;
}



/* === CHANGELOG === */
.changelog {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.changelog-title {
    color: #0a7a0a;
    text-align: center;
    font-size: 2em;
    margin-bottom: 40px;
    padding-bottom: 10px;
    border-bottom: 2px solid #0a7a0a;
}

.changelog-entry {
    background: #1a1a1a;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 30px;
    border: 1px solid #2a2a2a;
}

.changelog-date {
    color: #0a7a0a;
    font-size: 0.9em;
    margin-bottom: 10px;
}

.changelog-entry h2 {
    color: #fff;
    margin: 0 0 15px 0;
    font-size: 1.5em;
}

.changelog-entry ul {
    margin: 0;
    padding-left: 20px;
}

.changelog-entry li {
    color: #ddd;
    margin-bottom: 8px;
    line-height: 1.4;
}

@media (max-width: 768px) {
    .changelog {
        padding: 15px;
    }
    
    .changelog-title {
        font-size: 1.5em;
        margin-bottom: 30px;
    }
    
    .changelog-entry {
        padding: 15px;
        margin-bottom: 20px;
    }
    
    .changelog-entry h2 {
        font-size: 1.2em;
    }
}

/* === AGE VERIFICATION === */
.age-verification-overlay {
    position: fixed; 
    inset: 0; 
    background: rgba(0, 0, 0, 0.973);
    display: flex; 
    align-items: center; 
    justify-content: center; 
    z-index: 9999;
}
.age-verification-box {
    background: #111; 
    padding: 2rem; 
    border-radius: 1rem; 
    text-align: center; 
    color: #fff;
    max-width: 90%; 
    width: 400px;
    
    border: 1px solid #0a7a0a;
    box-shadow: 0 0 15px rgba(10, 122, 10, 0.5);
}
.age-verification-logo { max-width: 150px; height: auto; margin-bottom: 1.5rem; }
.age-verification-box button {
    margin: 1rem 0.5rem 0; 
    padding: 0.5rem 1.2rem; 
    color: #fff; 
    border: none;
    border-radius: 0.5rem; 
    font-size: 1rem; 
    cursor: pointer;
}
#yes-button { background: #0a7a0a; }
#yes-button:hover { background: #065a0a; }
#no-button { background: #555; }
#no-button:hover { background: #333; }














@media (max-width: 480px) {
    .age-verification-box {
        padding: 20px;
    }
    
    .age-verification-logo {
        max-width: 150px;
    }
    
    .age-verification-box p {
        font-size: 1em;
    }
    
    .age-verification-box button {
        padding: 10px 20px;
        font-size: 1em;
    }
}