/* estilo y reset general */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Roboto", "Arial", sans-serif;
    background-color: #ffffff;
    color: #f1f1f1;
    line-height: 1.5;
}

/* header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
     background-color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    z-index: 1000;
    border-bottom: 1px solid #c9c9c9;
}

.header-left,
.header-center,
.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-left {
    flex: 0 0 auto;
}

.header-center {
    flex: 0 1 728px;
    max-width: 728px;
}

.header-right {
    flex: 0 0 auto;
}

/* Logo */
.menu-icon {
    background: none;
    border: none;
    color: #f1f1f1;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
}

.menu-icon:hover {
  background-color: #ffffff;
}

.hamburger {
    display: block;
    width: 18px;
    height: 2px;
    border-bottom: 1px solid #3f3f3f;
    position: relative;
}

.hamburger::before,
.hamburger::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 2px;
    border-bottom: 1px solid #3f3f3f;
    left: 0;
}

.hamburger::before {
    top: -6px;
}

.hamburger::after {
    top: 6px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    color: #3f3f3f;
}

.logo-text {
    font-size: 20px;
    font-weight: 500;
    letter-spacing: -0.5px;
}

.region-code {
    font-size: 10px;
    color: #3f3f3f;
    vertical-align: super;
}

/* Búsqueda */
.search-form {
    display: flex;
    align-items: center;
    flex: 1;
    max-width: 640px;
}

.search-input {
    flex: 1;
    height: 40px;
    background-color: #ffffff;
    border: 1px solid #c9c9c9;
    border-radius: 40px 0 0 40px;
    color: #c9c9c9;
    padding: 0 16px;
    font-size: 16px;
    outline: none;
}

.search-input:focus {
    border-color: #c9c9c9;
}

.search-input::placeholder {
    color: #c9c9c9;
}

.search-button {
    width: 64px;
    height: 40px;
    background-color: #ffffff;
    border: 1px solid #c9c9c9;
    border-left: 1px solid #c9c9c9;
    border-radius: 0 40px 40px 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-button svg,
.voice-search svg,
.icon-button svg {
    fill: #3f3f3f;
}

.search-button:hover {
    background-color: #c9c9c9;
}

.voice-search {
    width: 40px;
    height: 40px;
    background-color: #ffffff;
    border: 1px solid #c9c9c9;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.voice-search:hover {
    background-color: #ffffff;
}

/* Botones del header */
.icon-button {
    width: 40px;
    height: 40px;
    background: none;
    border: 1px solid #c9c9c9;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-button {
    display: flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: 1px solid #c9c9c9;;
    border-radius: 18px;
    padding: 6px 12px;
    color: #3f3f3f;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}

.user-button svg {
    fill: #c9c9c9;
    color: #3f3f3f;
}
/* Barra lateral */

.sidebar {
    position: fixed;
    left: 0;
    top: 58px;
    width: 200px;
    height: calc(100vh - 58px);
    background-color: #ffffff;
    overflow-y: auto;
    padding: 12px 0;
    z-index: 800;
}

.sidebar::-webkit-scrollbar {
    width: 8px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: #ffffff;
    border-radius: 4px;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    padding: 8px 0;
  
}

.sidebar-section-title {
    padding: 8px 24px;
    font-size: 16px;
    font-weight: 500;
    color: #3f3f3f;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 10px 24px;
    color: #3f3f3f;
    text-decoration: none;
    font-size: 14px;
    font-weight: 400;
    transition: background-color 0.2s;
}

.sidebar-link:hover {
    background-color: #a9a9a9;
}

.sidebar-link svg {
    fill: #3f3f3f;
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.sidebar-divider {
    border: none;
    border-top: 1px solid #a9a9a9;
    margin: 12px 0;
}

.sidebar-footer {
    padding: 16px 24px;
}

.sidebar-footer-text {
    font-size: 13px;
    color: #3f3f3f;
    line-height: 1.6;
    margin-bottom: 16px;
}
/* ===== CONTENIDO PRINCIPAL ===== */
.main-content {
    margin-left: 240px;
    margin-top: 56px;
    padding: 24px;
    min-height: calc(100vh - 56px);
}

/* Categorías */
.chips-container {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    overflow-x: auto;
    padding-bottom: 8px;
}

.chips-container::-webkit-scrollbar {
    height: 8px;
}

.chips-container::-webkit-scrollbar-track {
    background: transparent;
}

.chips-container::-webkit-scrollbar-thumb {
    background: #3f3f3f;
    border-radius: 4px;
}

.chip {
    background-color: #272727;
    border: none;
    color: #f1f1f1;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: background-color 0.2s;
}

.chip:hover {
    background-color: #3f3f3f;
}

.chip.active {
    background-color: #f1f1f1;
    color: #0f0f0f;
}
/* ===== GRID DE VIDEOS ===== */
.videos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 40px 16px;
    margin-bottom: 40px;
}

.video-card {
    cursor: pointer;
}

.video-thumbnail {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 12px;
    background-color: #272727;
}

.video-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.2s;
}

.video-card:hover .video-thumbnail img {
    transform: scale(1.05);
}

.video-duration {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background-color: rgba(0, 0, 0, 0.8);
    color: #f1f1f1;
    padding: 3px 4px;
    border-radius: 2px;
    font-size: 12px;
    font-weight: 500;
}

.video-info {
    display: flex;
    gap: 12px;
}

.channel-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    flex-shrink: 0;
}

.video-details {
    flex: 1;
    min-width: 0;
}

.video-title {
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    color: #f1f1f1;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.channel-name {
    font-size: 12px;
    color: #aaa;
    margin-bottom: 2px;
}

.video-metadata {
    font-size: 12px;
    color: #aaa;
}

/* barra lateral */
.sidebar-link svg {
    width: 24px;
    height: 24px;
    fill: #0f0f0f; 
    flex-shrink: 0;
}

.sidebar-link span {
    color: #0f0f0f;
    font-size: 14px;
}

/* Alineación de los items de la sidebar */
.sidebar-link {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 10px 24px;
    text-decoration: none;
}

.sidebar-section-title {
    padding: 16px 24px 8px;
    font-size: 16px;
    font-weight: 500;
    color: #0f0f0f;
}

.section-title {
    font-size: 20px;
    margin-bottom: 20px;
    color: #0f0f0f;
}

/* ===== GRID DE VIDEOS (CORREGIDO) ===== */
.videos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

.video-card {
    width: 100%;
    cursor: pointer;
    transition: transform 0.2s;
}

.video-card:hover {
    transform: translateY(-4px); 
}

.video-thumbnail {
    width: 100%;
    aspect-ratio: 16 / 9; 
    background-color: #e5e5e5;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 12px;
}

.video-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* para que no se deforme la imagen*/
    display: block;
}

.video-title {
    font-size: 16px; 
    font-weight: 500;
    color: #0f0f0f; 
    line-height: 1.4;
    margin-top: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ===== GRID DE SHORTS (CORREGIDO) ===== */
.shorts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 40px;
    transform: translateY(-4px);
}

.short-thumbnail {
    width: 100%;
    aspect-ratio: 9 / 16; /* Vertical para móvil */
    background-color: #e5e5e5;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 8px;
}

.short-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.short-title {
    font-size: 14px;
    font-weight: 500;
    color: #0f0f0f;
}
/*Para que funcione en el telefono*/
@media (max-width: 768px) {
    .videos-grid, .shorts-grid {
        display: grid;
        /* ajusta en el movil */
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); 
        gap: 15px;
        padding: 10px;
    }
    .sidebar {
        display: none; 
    }
    .main-content {
        margin-left: 0 !important;
        padding: 10px;
    }
    .search-form {
        width: 100%;
        display: flex;
    }
    
    .search-input {
        width: 100%;
    }
}
/* para nombre y autor de los videos */
.channel-name {
    font-size: 14px;      
    color: #606060;      
    margin-top: 4px;    
    cursor: pointer;
}

.video-metadata {
    font-size: 14px;
    color: #606060;      
    margin-top: 2px;
}

.channel-name:hover {
    color: #0f0f0f;      
}