/* 
   RESET E VARIÁVEIS GLOBAIS
   Analogia: O "reset" é como nivelar o terreno antes de construir
*/
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box; /* Faz padding/borda não aumentarem largura total */
}

:root {
    --sidebar-width: 240px;
    --header-height: 56px;
    --primary-color: #ff0000;
    --gray-bg: #f9f9f9;
    --border-color: #ddd;
}

body {
    font-family: 'Roboto', Arial, sans-serif;
    background-color: var(--gray-bg);
}

/* HEADER FIXO */
.top-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    border-bottom: 1px solid var(--border-color);
    z-index: 100;
}

/* LAYOUT PRINCIPAL COM FLEXBOX */
.layout {
    display: flex;
    margin-top: var(--header-height);
    min-height: calc(100vh - var(--header-height));
}

/* SIDEBAR FIXA */
.sidebar {
    width: var(--sidebar-width);
    background: white;
    position: fixed;
    top: var(--header-height);
    bottom: 0;
    overflow-y: auto;
    border-right: 1px solid var(--border-color);
    padding: 12px 0;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 8px 24px;
    cursor: pointer;
    transition: background 0.2s;
}

.sidebar-item:hover {
    background-color: #f0f0f0;
}

.sidebar-item.active {
    background-color: #e5e5e5;
    font-weight: 500;
}

.search-container {
    width: 100%;
    height: 35px;
    padding: 0 10px;
    border: 1px solid #ddd;
    border-radius: 15px;
}


/* ÁREA PRINCIPAL COM MARGEM PARA SIDEBAR */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    gap: 24px;
    padding: 24px;
    max-width: calc(100% - var(--sidebar-width));
}

/* SEÇÃO DO VÍDEO (ESQUERDA) */
.video-section {
    flex: 3;
    min-width: 0; /* Evita overflow */
}

.video-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
    height: 0;
    background: black;
    border-radius: 12px;
    overflow: hidden;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* VÍDEOS RELACIONADOS (DIREITA) */
.related-sidebar {
    flex: 1;
    min-width: 300px;
}

.related-videos-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.related-video-item {
    display: flex;
    gap: 8px;
    cursor: pointer;
    transition: transform 0.2s;
}

.related-video-item:hover {
    transform: scale(1.02);
}

.related-thumb {
    width: 168px;
    height: 94px;
    background: #ddd;
    border-radius: 8px;
    object-fit: cover;
}

.related-info {
    flex: 1;
}

/* AÇÕES DO VÍDEO */
.video-actions {
    display: flex;
    gap: 16px;
    margin: 16px 0;
}

.action-btn {
    background: #f2f2f2;
    border: none;
    padding: 8px 16px;
    border-radius: 40px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* COMENTÁRIOS */
.comments-section {
    margin-top: 24px;
}

.new-comment {
    display: flex;
    gap: 12px;
    margin: 16px 0;
}

.new-comment input {
    flex: 1;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 24px;
}

.comment-item {
    background: white;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 12px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

/* RESPONSIVIDADE */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
        flex-direction: column;
    }
    
    .related-sidebar {
        min-width: auto;
    }
}