:root {
    --primary-color: #000000;
    --secondary-color: #ff0000;
    --text-color: #ffffff;
    --sidebar-bg: #000000;
    --content-bg: #121212;
    --card-bg: #1e1e1e;
    --hover-color: #ff3333;
    --border-color: #ff0000;
    --shadow-color: rgba(255, 0, 0, 0.2);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--content-bg);
    color: var(--text-color);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Layout Principal */
.d-flex {
    min-height: 100vh;
    width: 100%;
}

/* Sidebar */
.sidebar {
    width: 250px;
    min-height: 100vh;
    background-color: var(--sidebar-bg);
    padding-top: 20px;
    border-right: 2px solid var(--secondary-color);
    box-shadow: 2px 0 10px var(--shadow-color);
    position: fixed;
    left: 0;
    top: 0;
    z-index: 1000;
}

.logo-container {
    text-align: center;
    padding: 15px;
    background: var(--primary-color);
    margin-bottom: 20px;
    border-bottom: 2px solid var(--secondary-color);
}

.logo-container img {
    max-width: 200px;
    height: auto;
}

.sidebar a {
    color: var(--text-color);
    text-decoration: none;
    padding: 15px 20px;
    display: block;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
    margin: 5px 0;
}

.sidebar a:hover,
.sidebar a.active {
    background-color: var(--secondary-color);
    color: var(--text-color);
    border-left: 3px solid var(--text-color);
}

.sidebar a i {
    margin-right: 10px;
    width: 20px;
    text-align: center;
}

/* Conteúdo Principal */
.content {
    flex: 1;
    margin-left: 250px;
    padding: 20px;
    background-color: var(--content-bg);
    min-height: 100vh;
    width: calc(100% - 250px);
}

/* Cards e Formulários */
.card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    box-shadow: 0 0 15px var(--shadow-color);
    margin-bottom: 20px;
    transition: transform 0.3s ease;
    /* Adicionado display: flex e flex-direction: column para o card container */
    display: flex;
    flex-direction: column;
}

.card:hover {
    transform: translateY(-5px);
}

/* --- CORREÇÕES PARA PADRONIZAÇÃO DE TAMANHOS (min-height) --- */

/* Força o card-body a ser um container flexível verticalmente */
.card-body.d-flex {
    padding: 25px;
    display: flex;
    flex-direction: column;
    /* NOVO: Altura mínima para o corpo do card, para evitar encolhimento excessivo */
    min-height: 100px; 
}

/* Garante que a descrição ocupe o espaço extra e empurre o rodapé para baixo */
.card-text.flex-grow-1 {
    flex-grow: 1;
    /* NOVO: Altura mínima para a área de texto, para garantir o visual */
    min-height: 30px; 
}

/* Estiliza a área de mídia/download para garantir bordas uniformes */
.ratio.tutorial-media {
    overflow: hidden; 
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
    border-bottom: 2px solid var(--secondary-color); 
}

/* Estilo para o bloco de download */
.ratio.tutorial-media .text-center {
    background-color: var(--primary-color); 
    padding: 20px;
    width: 100%;
}
/* FIM CORREÇÕES DE PADRONIZAÇÃO */

.card-body {
    color: var(--text-color);
    /* Removido o padding: 25px daqui, pois foi para .card-body.d-flex */
}

.form-control {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 12px;
    border-radius: 5px;
}

.form-control:focus {
    background-color: var(--card-bg);
    border-color: var(--secondary-color);
    color: var(--text-color);
    box-shadow: 0 0 0 0.2rem var(--shadow-color);
}

.form-label {
    color: var(--text-color);
    font-weight: 500;
    margin-bottom: 8px;
}

/* Botões */
.btn-primary {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
    padding: 10px 20px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background-color: var(--hover-color);
    border-color: var(--hover-color);
    transform: translateY(-2px);
}

/* Estilo para o botão de Download (btn-success) */
.btn-success {
    background-color: #198754; 
    border-color: #198754; 
    padding: 10px 20px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-success:hover {
    background-color: #157347;
    border-color: #157347;
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: var(--primary-color);
    border-color: var(--secondary-color);
    color: var(--text-color);
    padding: 10px 20px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background-color: #333333;
    border-color: var(--secondary-color);
    transform: translateY(-2px);
}

/* Tabelas */
.table {
    color: var(--text-color);
    background-color: var(--card-bg);
    border-radius: 10px;
    overflow: hidden;
}

.table thead th {
    background-color: var(--primary-color);
    border-bottom: 2px solid var(--secondary-color);
    color: var(--text-color);
    padding: 15px;
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(255, 0, 0, 0.05);
}

.table td {
    padding: 15px;
    vertical-align: middle;
}

/* Container de Vídeo */
.video-container {
    background: var(--primary-color);
    padding: 20px 0;
    margin: 20px 0;
    border-radius: 10px;
    border: 1px solid var(--secondary-color);
    box-shadow: 0 0 20px var(--shadow-color);
}

.video-container video {
    max-width: 100%;
    margin: 0 auto;
    display: block;
    border-radius: 5px;
}

.video-info {
    background: var(--card-bg);
    padding: 20px;
    border-radius: 10px;
    margin: 15px 0;
    border: 1px solid var(--secondary-color);
}

.video-info i {
    color: var(--secondary-color);
    margin-right: 10px;
}

/* Mobile Responsive Design */
@media (max-width: 768px) {
    .sidebar {
        min-height: auto;
        position: fixed;
        top: 0;
        left: -100%;
        width: 85%;
        z-index: 1000;
        transition: left 0.3s ease;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.5);
    }

    .sidebar.active {
        left: 0;
    }

    .content {
        margin-left: 0;
        padding: 15px;
        width: 100%;
    }

    .logo-container {
        padding: 10px;
    }

    .logo-container img {
        max-width: 150px;
    }

    .mobile-menu-toggle {
        display: block;
        position: fixed;
        top: 15px;
        right: 15px;
        z-index: 1001;
        background: var(--secondary-color);
        border: none;
        color: var(--text-color);
        padding: 12px;
        border-radius: 50%;
        box-shadow: 0 2px 10px var(--shadow-color);
        transition: all 0.3s ease;
    }

    .mobile-menu-toggle:hover {
        background: var(--hover-color);
        transform: scale(1.1);
    }

    .tutorial-content {
        padding: 15px;
        margin: 10px 0;
    }

    .video-container {
        margin: 10px 0;
        padding: 10px 0;
    }

    .table-responsive {
        margin: 0 -15px;
        border-radius: 10px;
        overflow: hidden;
    }

    .card {
        margin: 10px 0;
        border-radius: 10px;
    }

    .card-body {
        padding: 15px;
    }

    .form-control {
        font-size: 16px;
        padding: 10px;
        margin-bottom: 10px;
    }
    
    textarea.form-control {
        min-height: 100px;
    }
    
    .btn {
        width: 100%;
        padding: 12px;
        margin-top: 10px;
        font-size: 16px;
    }
    
    .form-label {
        font-size: 14px;
        margin-bottom: 5px;
    }

    h2 {
        font-size: 1.5rem;
        margin-bottom: 15px;
    }

    h3 {
        font-size: 1.2rem;
    }

    .video-info {
        padding: 15px;
    }

    .btn-sm {
        padding: 8px 12px;
        font-size: 14px;
        width: auto;
        margin-top: 0;
    }

    .table td {
        padding: 10px;
    }

    .table-responsive {
        margin: 0;
        padding: 0;
    }

    .form-control {
        font-size: 16px;
    }

    textarea.form-control {
        min-height: 120px;
    }

    .card.mb-4 {
        scroll-margin-top: 20px;
    }
}

/* Animações */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.5s ease-in;
}

/* Melhorias de Acessibilidade */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Scrollbar Personalizada */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--content-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--secondary-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--hover-color);
}

/* Login Container */
.login-container {
    max-width: 400px;
    margin: 100px auto;
    padding: 20px;
    background: var(--card-bg);
    border-radius: 10px;
    box-shadow: 0 0 20px var(--shadow-color);
    border: 1px solid var(--border-color);
}

.login-container h2 {
    color: var(--text-color);
    margin-bottom: 20px;
}

.login-container .form-label {
    color: var(--text-color);
}

.login-container .form-control {
    background-color: var(--card-bg);
    border-color: var(--border-color);
    color: var(--text-color);
}

.login-container .form-control:focus {
    background-color: var(--card-bg);
    border-color: var(--secondary-color);
    color: var(--text-color);
    box-shadow: 0 0 0 0.2rem var(--shadow-color);
}

.login-container .btn-primary {
    width: 100%;
    margin-top: 10px;
}

/* Estilos para a página de avaliações */
.rating {
    display: flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
    margin-bottom: 1rem;
}

.rating input {
    display: none;
}

.rating label {
    cursor: pointer;
    font-size: 30px;
    color: #ddd;
    padding: 5px;
    transition: color 0.2s ease;
}

.rating label:before {
    content: '★';
}

.rating input:checked ~ label,
.rating label:hover,
.rating label:hover ~ label {
    color: #ffd700;
}

.rating-card {
    background: #2a2a2a;
    border: 1px solid #3a3a3a;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.rating-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.rating-card .card-body {
    padding: 1.5rem;
}

.rating-card .card-title {
    color: #fff;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.rating-card .card-text {
    color: #ddd;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.rating-card small {
    color: #888;
    font-size: 0.8rem;
}

.rating-card .text-warning {
    color: #ffd700 !important;
    font-size: 1.2rem;
}