/* Reset et styles de base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Roboto', Arial, sans-serif;
}

body {
    background-color: #0f0f0f;
    color: #f1f1f1;
}

a {
    text-decoration: none;
    color: inherit;
}

/* En-tête */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 16px;
    height: 56px;
    background-color: #0f0f0f;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left, .header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-center {
    display: flex;
    align-items: center;
    flex: 0 1 660px;
    margin: 10px 40px;
}

.logo {
    height: 20px;
    cursor: pointer;
}

.search-bar {
    display: flex;
    flex: 1;
    height: 40px;
}

.search-bar input {
    flex: 1;
    padding: 0 16px;
    border: 1px solid #303030;
    background-color: #121212;
    color: #f1f1f1;
    border-radius: 20px 0 0 20px;
    font-size: 16px;
    outline: none;
}

.search-bar button {
    width: 64px;
    background: #323232;
    color: #f1f1f1;
    border: 1px solid #303030;
    border-left: none;
    border-radius: 0 20px 20px 0;
    cursor: pointer;
}

.voice-search {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: #181818;
    color: #f1f1f1;
    margin-left: 8px;
    cursor: pointer;
}

.profile-pic img {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
}

/* Conteneur principal */
.container {
    display: flex;
    height: calc(100vh - 56px);
}

/* Barre latérale */
.sidebar {
    width: 240px;
    padding: 12px 0;
    background-color: #0f0f0f;
    overflow-y: auto;
    position: fixed;
    top: 56px;
    bottom: 0;
    left: 0;
    color: #f1f1f1;
    transition: transform 0.3s ease-in-out;
    /* Masquer la scrollbar par défaut */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE et Edge */
}

/* Masquer la scrollbar pour WebKit (Chrome, Safari) */
.sidebar::-webkit-scrollbar {
    display: none;
    width: 8px;
}

/* Afficher la scrollbar au survol */
.sidebar:hover {
    scrollbar-width: thin; /* Firefox */
    scrollbar-color: #606060 #0f0f0f;
}

.sidebar:hover::-webkit-scrollbar {
    display: block;
}

/* Style de la piste de défilement */
.sidebar::-webkit-scrollbar-track {
    background: #0f0f0f;
}

/* Style du curseur de défilement */
.sidebar::-webkit-scrollbar-thumb {
    background-color: #606060;
    border-radius: 4px;
    border: 2px solid #0f0f0f;
}

/* Style du curseur de défilement au survol */
.sidebar::-webkit-scrollbar-thumb:hover {
    background-color: #909090;
}

.sidebar:hover {
    scrollbar-color: #909090 #0f0f0f;
}

.sidebar-section {
    padding: 8px 0;
    border-bottom: 1px solid #303030;
    margin-bottom: 12px;
}

.sidebar-section:last-child {
    border-bottom: none;
}

.sidebar-item {
    display: flex;
    align-items: center;
    padding: 8px 24px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
    border-radius: 10px;
    margin: 2px;
}

.sidebar-item:hover {
    background-color: #303030;
}

.sidebar-item.active {
    background-color: #303030;
    font-weight: 500;
}

.sidebar-item i {
    margin-right: 24px;
    width: 24px;
    text-align: center;
    color: #f1f1f1;
    font-size: 20px;
}

/* Style pour les titres de section */
.sidebar h3 {
    font-size: 16px;
    font-weight: 500;
    padding: 8px 24px;
    margin: 0;
    color: #aaa;
    text-transform: uppercase;
    font-size: 14px;
}

/* Style pour les abonnements */
.channel-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    margin-right: 24px;
    object-fit: cover;
}

/* Contenu principal */
.content {
    margin-left: 240px;
    padding: 20px;
    flex: 1;
    overflow-y: auto;
    background-color: #0f0f0f;
}

/* Catégories */
.categories {
    display: flex;
    gap: 12px;
    padding: 12px 0 24px;
    border-bottom: 1px solid #303030;
    margin-bottom: 24px;
    overflow-x: auto;
    white-space: nowrap;
}

.category {
    padding: 6px 12px;
    border: 1px solid #303030;
    border-radius: 16px;
    background-color: #303030;
    color: #f1f1f1;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.category:hover {
    background-color: #4d4d4d;
}

.category.active {
    background-color: #f1f1f1;
    color: #0f0f0f;
    border-color: #f1f1f1;
}

/* Grille de vidéos */
.videos {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px 16px;
}

.video-card {
    cursor: pointer;
}

.thumbnail {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
    background-color: #1f1f1f;
    margin-bottom: 12px;
    border-radius: 10px;
    overflow: hidden;
}

.thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.duration {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 2px 4px;
    border-radius: 2px;
    font-size: 12px;
}

.video-info {
    display: flex;
    gap: 12px;
}

.channel-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: #2c2c2c;
}

.video-details h3 {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.channel-name, .video-stats {
    font-size: 14px;
    color: #aaa;
    margin-top: 4px;
}

/* Styles pour les icônes */
i {
    font-size: 20px;
    color: #f1f1f1;
    cursor: pointer;
}

/* Barre de défilement personnalisée */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #0f0f0f;
}

::-webkit-scrollbar-thumb {
    background: #303030;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #4d4d4d;
}