/* Reset e configurações básicas */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
header {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    padding: 20px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.logo h1 {
    font-size: 2.5rem;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo p {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Campo de Pesquisa */
.search-container {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin: 30px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.search-form {
    margin-bottom: 15px;
}

.search-input-group {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.search-input {
    flex: 1;
    min-width: 250px;
    padding: 12px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.search-input:focus {
    outline: none;
    border-color: #4CAF50;
    background: white;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

.search-button {
    padding: 12px 24px;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.search-button:hover {
    background: #45a049;
    transform: translateY(-1px);
}

.clear-search {
    padding: 8px 16px;
    background: #dc3545;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.clear-search:hover {
    background: #c82333;
    transform: translateY(-1px);
}

.search-results-info {
    color: #666;
    font-size: 0.95rem;
    padding: 10px;
    background: #e8f5e8;
    border-radius: 8px;
    border-left: 4px solid #4CAF50;
}

.search-results-info strong {
    color: #4CAF50;
}

.search-tips {
    color: #666;
    font-size: 0.9rem;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #17a2b8;
}

.search-tips kbd {
    background: #e9ecef;
    border: 1px solid #ced4da;
    border-radius: 3px;
    box-shadow: 0 1px 0 rgba(0,0,0,0.2);
    color: #495057;
    display: inline-block;
    font-size: 0.8rem;
    padding: 2px 6px;
    white-space: nowrap;
}

/* Destaque de termos pesquisados */
mark {
    background-color: #ffeb3b;
    color: #333;
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: 600;
}

/* Navegação */
.nav-tabs {
    background: white;
    border-bottom: 3px solid #4CAF50;
    padding: 15px 0;
    margin-bottom: 30px;
}

.nav-tabs ul {
    list-style: none;
    display: flex;
    gap: 30px;
}

.nav-tabs a {
    text-decoration: none;
    color: #666;
    font-weight: 500;
    padding: 10px 0;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
}

.nav-tabs a:hover,
.nav-tabs a.active {
    color: #4CAF50;
    border-bottom-color: #4CAF50;
}

/* Grid de Aulas - Estilo YouTube */
.aulas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 25px;
    padding: 20px 0;
}

.aula-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 15px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    cursor: pointer;
}

.aula-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 25px rgba(0,0,0,0.15);
}

.thumbnail-container {
    position: relative;
    width: 100%;
    height: 200px;
    background: #f0f0f0;
    overflow: hidden;
}

.thumbnail-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.aula-card:hover .thumbnail-container img {
    transform: scale(1.05);
}

.play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.7);
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: all 0.3s ease;
}

.aula-card:hover .play-overlay {
    background: rgba(76, 175, 80, 0.9);
    transform: translate(-50%, -50%) scale(1.1);
}

.card-content {
    padding: 15px;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-description {
    font-size: 0.9rem;
    color: #666;
    line-height: 1.4;
    margin-bottom: 12px;
    padding: 8px 0;
    border-left: 3px solid #e8f5e8;
    padding-left: 10px;
    background: #fafafa;
    border-radius: 0 4px 4px 0;
}

.card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #666;
    font-size: 0.9rem;
}

.card-date {
    background: #e8f5e8;
    color: #4CAF50;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
}

/* Página Individual da Aula */
.aula-individual {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 15px rgba(0,0,0,0.08);
    margin-bottom: 30px;
}

.video-player {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 56.25%; /* 16:9 */
    background: #000;
}

.video-player iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.aula-info {
    padding: 25px;
}

.aula-title {
    font-size: 1.8rem;
    color: #333;
    margin-bottom: 10px;
}

.aula-meta {
    color: #666;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.aula-description {
    font-size: 1rem;
    line-height: 1.6;
    color: #555;
    margin-bottom: 25px;
}

.materiais-section {
    background: #f8fdf8;
    border: 1px solid #e8f5e8;
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
}

.materiais-section h3 {
    color: #4CAF50;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.materiais-content {
    background: white;
    padding: 15px;
    border-radius: 6px;
    border-left: 4px solid #4CAF50;
    white-space: pre-line;
}

/* Área Administrativa */
.admin-header {
    background: linear-gradient(135deg, #2e7d2e, #4CAF50);
    color: white;
    text-align: center;
    padding: 20px;
    margin-bottom: 30px;
}

.admin-form {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.08);
    margin-bottom: 30px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    color: #333;
    font-weight: 500;
    margin-bottom: 8px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #4CAF50;
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.btn {
    background: #4CAF50;
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.btn:hover {
    background: #45a049;
}

.btn-danger {
    background: #f44336;
}

.btn-danger:hover {
    background: #da190b;
}

.btn-small {
    padding: 6px 12px;
    font-size: 0.9rem;
}

/* Mensagens */
.alert {
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-danger {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Login */
.login-container {
    max-width: 400px;
    margin: 100px auto;
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.1);
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header h2 {
    color: #4CAF50;
    margin-bottom: 10px;
}

/* Footer */
footer {
    background: #333;
    color: white;
    text-align: center;
    padding: 30px 0;
    margin-top: 50px;
}

.admin-link {
    color: #4CAF50;
    text-decoration: none;
    font-size: 0.9rem;
    margin-top: 10px;
    display: inline-block;
}

.admin-link:hover {
    color: #45a049;
}

/* Responsividade */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .logo h1 {
        font-size: 2rem;
    }
    
    .aulas-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .nav-tabs ul {
        flex-direction: column;
        gap: 10px;
    }
    
    .card-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    /* Pesquisa responsiva */
    .search-container {
        margin: 20px 0;
        padding: 15px;
    }
    
    .search-input-group {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }
    
    .search-input {
        min-width: auto;
    }
    
    .search-button {
        width: 100%;
        justify-self: center;
    }
    
    .clear-search {
        align-self: center;
        text-align: center;
    }
}

/* Arquivos de download */
.arquivo-item:hover {
    border-color: #4CAF50 !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.2);
}

.arquivos-grid {
    max-height: 400px;
    overflow-y: auto;
    padding-right: 5px;
}

.arquivos-grid::-webkit-scrollbar {
    width: 6px;
}

.arquivos-grid::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.arquivos-grid::-webkit-scrollbar-thumb {
    background: #4CAF50;
    border-radius: 3px;
}

.arquivos-grid::-webkit-scrollbar-thumb:hover {
    background: #45a049;
}

/* Estilos para input de arquivo */
input[type="file"] {
    padding: 10px !important;
    border: 2px dashed #4CAF50 !important;
    background: #f8fdf8 !important;
    border-radius: 6px !important;
    cursor: pointer;
}

input[type="file"]:hover {
    background: #f0f8f0 !important;
    border-color: #45a049 !important;
}

input[type="file"]:focus {
    outline: none !important;
    border-color: #4CAF50 !important;
    box-shadow: 0 0 5px rgba(76, 175, 80, 0.3) !important;
}

/* Reordenação de aulas */
.aulas-reorder {
    max-height: 500px;
    overflow-y: auto;
    padding: 10px;
    border: 2px dashed #e0e0e0;
    border-radius: 8px;
    background: #fafafa;
}

.aula-reorder-item {
    display: flex;
    align-items: center;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
    cursor: move;
    transition: all 0.3s ease;
    user-select: none;
}

.aula-reorder-item:hover {
    border-color: #4CAF50;
    box-shadow: 0 2px 10px rgba(76, 175, 80, 0.2);
    transform: translateY(-2px);
}

.aula-reorder-item.dragging {
    opacity: 0.5;
    transform: rotate(5deg);
}

.drag-handle {
    font-size: 1.5rem;
    color: #999;
    margin-right: 15px;
    cursor: grab;
    padding: 5px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.drag-handle:hover {
    background: #f0f0f0;
    color: #4CAF50;
}

.drag-handle:active {
    cursor: grabbing;
}

.aula-info {
    flex: 1;
    margin-right: 15px;
}

.aula-info strong {
    color: #333;
    display: block;
    margin-bottom: 5px;
    font-size: 1.1rem;
}

.ordem-atual {
    background: #e8f5e8;
    color: #4CAF50;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
}

.ordem-atual .posicao {
    font-weight: bold;
}

/* Scrollbar personalizada para reordenação */
.aulas-reorder::-webkit-scrollbar {
    width: 8px;
}

.aulas-reorder::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.aulas-reorder::-webkit-scrollbar-thumb {
    background: #4CAF50;
    border-radius: 4px;
}

.aulas-reorder::-webkit-scrollbar-thumb:hover {
    background: #45a049;
}

/* Loading states */
.loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

.no-aulas {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.no-aulas h3 {
    color: #4CAF50;
    margin-bottom: 10px;
}

/* ===== ESTILOS PARA MARKDOWN ===== */

/* Títulos em markdown */
.aula-description h1,
.card-description h1 {
    color: #2e7d32;
    font-size: 1.8rem;
    font-weight: 600;
    margin: 20px 0 15px 0;
    padding-bottom: 8px;
    border-bottom: 2px solid #e8f5e8;
}

.aula-description h2,
.card-description h2 {
    color: #388e3c;
    font-size: 1.5rem;
    font-weight: 600;
    margin: 18px 0 12px 0;
    padding-bottom: 6px;
    border-bottom: 1px solid #e8f5e8;
}

.aula-description h3,
.card-description h3 {
    color: #4caf50;
    font-size: 1.3rem;
    font-weight: 600;
    margin: 15px 0 10px 0;
}

/* Texto em negrito e itálico */
.aula-description strong,
.card-description strong {
    color: #2e7d32;
    font-weight: 600;
}

.aula-description em,
.card-description em {
    color: #388e3c;
    font-style: italic;
}

/* Links */
.aula-description a,
.card-description a {
    color: #4caf50;
    text-decoration: none;
    border-bottom: 1px dotted #4caf50;
    transition: all 0.3s ease;
}

.aula-description a:hover,
.card-description a:hover {
    color: #2e7d32;
    border-bottom: 1px solid #2e7d32;
    background-color: rgba(76, 175, 80, 0.1);
    padding: 2px 4px;
    border-radius: 3px;
}

/* Listas */
.aula-description ul,
.card-description ul {
    margin: 15px 0;
    padding-left: 0;
    list-style: none;
}

.aula-description ul li,
.card-description ul li {
    position: relative;
    padding-left: 25px;
    margin-bottom: 8px;
    line-height: 1.6;
}

.aula-description ul li:before,
.card-description ul li:before {
    content: "🌿";
    position: absolute;
    left: 0;
    top: 0;
    color: #4caf50;
    font-size: 14px;
}

.aula-description ol,
.card-description ol {
    margin: 15px 0;
    padding-left: 20px;
    counter-reset: markdown-counter;
}

.aula-description ol li,
.card-description ol li {
    margin-bottom: 8px;
    line-height: 1.6;
    counter-increment: markdown-counter;
    position: relative;
}

.aula-description ol li:before,
.card-description ol li:before {
    content: counter(markdown-counter) ".";
    color: #4caf50;
    font-weight: 600;
    margin-right: 8px;
}

/* Código inline */
.aula-description code,
.card-description code {
    background: #f8f8f8;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 2px 6px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    color: #d81b60;
    white-space: nowrap;
}

/* Blocos de código */
.aula-description pre,
.card-description pre {
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-left: 4px solid #4caf50;
    border-radius: 6px;
    padding: 15px;
    margin: 20px 0;
    overflow-x: auto;
}

.aula-description pre code,
.card-description pre code {
    background: none;
    border: none;
    padding: 0;
    color: #333;
    white-space: pre;
}

/* Citações */
.aula-description blockquote,
.card-description blockquote {
    background: #f9f9f9;
    border-left: 4px solid #4caf50;
    margin: 20px 0;
    padding: 15px 20px;
    font-style: italic;
    color: #666;
    border-radius: 0 6px 6px 0;
}

.aula-description blockquote p,
.card-description blockquote p {
    margin: 0;
}

/* Linha horizontal */
.aula-description hr,
.card-description hr {
    border: none;
    height: 2px;
    background: linear-gradient(to right, transparent, #4caf50, transparent);
    margin: 25px 0;
    border-radius: 1px;
}

/* Responsividade para markdown */
@media (max-width: 768px) {
    .aula-description h1,
    .card-description h1 {
        font-size: 1.5rem;
    }
    
    .aula-description h2,
    .card-description h2 {
        font-size: 1.3rem;
    }
    
    .aula-description h3,
    .card-description h3 {
        font-size: 1.2rem;
    }
    
    .aula-description pre,
    .card-description pre {
        padding: 10px;
        font-size: 0.8rem;
    }
    
    .aula-description blockquote,
    .card-description blockquote {
        padding: 10px 15px;
        margin: 15px 0;
    }
} 