/* ==================== RESET Y CONFIGURACIÓN BASE ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', Arial, sans-serif;
    background-color: #ffffff;
    color: #0f0f0f;
}

button {
    border: none;
    background: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    /* Centra verticalmente */
    justify-content: center;
    /* Centra horizontalmente */
    gap: 8px;
}

a {
    text-decoration: none;
    color: inherit;
}

/* ==================== 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;
    border-bottom: 1px solid #e5e5e5;
    z-index: 1000;
}

.header-izq {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-center {
    flex: 1;
    max-width: 640px;
    margin: 0 40px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Logo */
.logo {
    display: flex;
    align-items: center;
    gap: 4px;
}

.crear-button {
    display: flex;
    align-items: center;
    gap: 2px;
}

.logo-icon {
    width: 32px;
    height: 32px;
    background-color: #ff0000;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    font-size: 20px;
    font-weight: bold;
}

.logo-text {
    font-size: 20px;
    font-weight: bold;
}

/* Icon buttons */
.icono-button {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.icon-button:hover {
    background-color: #f2f2f2;
}

.user-icon {
    background-color: #065fd4;
    color: white;
    border-radius: 30px;
}

.user-icon:hover {
    background-color: #0557c2;
}


/* Search bar */
.search-container {
    display: flex;
    height: 40px;
}

.search-input {
    flex: 1;
    padding: 0 16px;
    border: 1px solid #cccccc;
    border-right: none;
    border-radius: 40px 0 0 40px;
    font-size: 16px;
    outline: none;
}

.search-input:focus {
    border-color: #065fd4;
}

.search-button {
    width: 64px;
    border: 1px solid #cccccc;
    border-left: none;
    border-radius: 0 40px 40px 0;
    background-color: #f8f8f8;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.search-button:hover {
    background-color: #f0f0f0;
}

/* ==================== SIDEBAR ==================== */
.sidebar {
    position: fixed;
    left: 0;
    top: 56px;
    width: 240px;
    height: calc(100vh - 56px);
    background-color: #ffffff;
    overflow-y: auto;
    padding: 12px 0;
    border-right: 1px solid #e5e5e5;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
}

.sidebar-section {
    display: flex;
    flex-direction: column;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 400;
    transition: background-color 0.2s;
}

.sidebar-item:hover {
    background-color: #f2f2f2;
}

.sidebar-item.active {
    background-color: #f2f2f2;
    font-weight: 500;
}

.sidebar-item svg {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.sidebar-separator {
    height: 1px;
    background-color: #e5e5e5;
    margin: 12px 0;
}

/* ==================== MAIN CONTENT ==================== */
.main-content {
    margin-left: 240px;
    margin-top: 56px;
    padding: 24px;
}

/* Category chips */
.category-chips {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    overflow-x: auto;
    padding-bottom: 8px;
}

/* Ocultar scrollbar pero mantener funcionalidad */
.category-chips::-webkit-scrollbar {
    display: none;
}

.chip {
    padding: 8px 16px;
    background-color: #f2f2f2;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    transition: background-color 0.2s;
}

/*deberia de tener 18 px, pero me gusta más con 21*/
.chip-crear {
    border-radius: 21px;
}

.chip:hover {
    background-color: #e5e5e5;
}

.chip-active {
    background-color: #0f0f0f;
    color: white;
}

.chip-active:hover {
    background-color: #272727;
}

/* ==================== VIDEO GRID ==================== */
.video-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 40px 16px;
}

/* Video card */
.video-card {
    cursor: pointer;
    flex: 1 1 320px;
}

/* Video thumbnail */
.video-thumbnail {
    position: relative;
    aspect-ratio: 16/9;
    background-color: #f2f2f2;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 12px;
}

.video-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.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: white;
    padding: 4px 6px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

/* Video info */
.video-info {
    display: flex;
    gap: 12px;
}

.channel-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: #f2f2f2;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.channel-avatar svg {
    width: 20px;
    height: 20px;
    stroke: #606060;
}

.video-details {
    flex: 1;
    min-width: 0;
}

.video-title {
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    margin-bottom: 4px;
    /* Limitar a 2 líneas */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.video-channel {
    font-size: 12px;
    color: #606060;
    margin-bottom: 2px;
}

.video-metadata {
    font-size: 12px;
    color: #606060;
}

/* ==================== RESPONSIVE ==================== */
/* Tablet */
@media (max-width: 1024px) {
    .video-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}

/* Mobile */
@media (max-width: 768px) {
    .sidebar {
        width: 72px;
    }

    .sidebar-item span {
        display: none;
    }

    .sidebar-item {
        justify-content: center;
        padding: 16px 12px;
    }

    .main-content {
        margin-left: 72px;
    }

    .header-center {
        margin: 0 16px;
    }

    .video-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .sidebar {
        display: none;
    }

    .main-content {
        margin-left: 0;
    }

    .header-center {
        display: none;
    }
}