/* --- RESET & BASE --- */
:root {
    --primary: #ff9500;
    --bg-black: #0a0a0a;
    --card-bg: #161616;
    --text-main: #ffffff;
    --text-dim: #b3b3b3;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { background: var(--bg-black); color: var(--text-main); font-family: 'Segoe UI', sans-serif; }
a { text-decoration: none; color: inherit; }

/* --- HEADER FIX --- */
.main-header { background: #000; padding: 10px 15px; border-bottom: 1px solid #222; position: sticky; top: 0; z-index: 1000; }
.header-content { max-width: 1300px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 15px; }

.search-bar { 
    display: flex; background: #222; border-radius: 20px; padding: 5px 15px; flex: 1; max-width: 400px; 
}
.search-bar input { background: transparent; border: none; color: #fff; width: 100%; outline: none; padding: 5px; }
.search-bar button { background: transparent; border: none; color: var(--primary); }

.user-menu { display: flex; align-items: center; gap: 10px; }
.nav-avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; border: 1.5px solid var(--primary); }
.user-profile-link { display: flex; align-items: center; gap: 8px; }

/* --- CATEGORIES NAV --- */
.categories-nav { background: var(--bg-black); padding: 10px 0; border-bottom: 1px solid #111; position: sticky; top: 55px; z-index: 999; }
.categories-container { display: flex; gap: 10px; overflow-x: auto; padding: 0 15px; scrollbar-width: none; }
.cat-item { background: #222; padding: 6px 15px; border-radius: 20px; font-size: 0.85rem; white-space: nowrap; border: 1px solid #333; }
.cat-item.active { background: var(--primary); color: #000; font-weight: bold; }

/* --- GRID INDEX (LA RÉPARATION) --- */
.container { max-width: 1300px; margin: 0 auto; padding: 20px 15px; }
.grid { 
    display: grid; 
    grid-template-columns: repeat(2, 1fr); /* 2 colonnes sur mobile */
    gap: 15px; 
}

.card { background: var(--card-bg); border-radius: 10px; overflow: hidden; transition: 0.3s; border: 1px solid #222; }
.card:hover { transform: translateY(-3px); border-color: #444; }
.thumbnail-link img { width: 100%; aspect-ratio: 16/9; object-fit: cover; display: block; }
.info { padding: 12px; }
.video-title { font-size: 0.9rem; font-weight: 600; margin-bottom: 8px; line-height: 1.3; height: 2.6em; overflow: hidden; }
.stats { display: flex; justify-content: space-between; font-size: 0.75rem; color: var(--text-dim); }

/* --- AJUSTEMENTS PC --- */
@media (min-width: 768px) {
    .grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; }
    .user-name { display: inline; }
}

@media (max-width: 480px) {
    .search-bar { display: none; } /* On cache la recherche sur très petit écran pour le logo */
    .user-name { display: none; }
}

/* --- PROFIL (Gardé car fonctionnel) --- */
.profile-header { background: var(--card-bg); padding: 30px; border-radius: 15px; display: flex; flex-direction: column; align-items: center; gap: 20px; border: 1px solid #333; margin-bottom: 30px; }
.avatar-wrapper { position: relative; width: 120px; height: 120px; }
.main-avatar { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; border: 3px solid var(--primary); }
.upload-overlay { position: absolute; bottom: 5px; right: 5px; background: var(--primary); width: 35px; height: 35px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #000; cursor: pointer; }
.album-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.album-item { aspect-ratio: 1/1; border-radius: 8px; overflow: hidden; }
.album-item img { width: 100%; height: 100%; object-fit: cover; }
@media (min-width: 768px) {
    .profile-header { flex-direction: row; text-align: left; }
    .album-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
}
:root {
    --primary: #ff9500; /* Orange Benganga */
    --accent: #ff3b30;  /* Rouge pour les likes/logout */
}

/* Empêche le zoom automatique sur iPhone lors du clic sur un bouton */
input, button {
    font-size: 16px !important;
}

/* Animation de pression sur les boutons */
.nav-item:active, .btn-like:active {
    transform: scale(0.9);
    transition: 0.1s;
}