/* Estilos customizados */

:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #0dcaf0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
}

/* Navbar */
.navbar-brand {
    font-size: 1.5rem;
}

/* Cards */
.article-card {
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    border: 1px solid #e9ecef;
}

.article-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.community-card {
    transition: transform 0.2s ease-in-out;
    overflow: hidden;
}

.community-card:hover {
    transform: translateY(-3px);
}

.community-bg {
    height: 120px;
    background-size: cover;
    background-position: center;
    background-color: linear-gradient(135deg, var(--primary-color), var(--info-color));
}

.community-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid white;
    margin-top: -25px;
}

/* Article Stats */
.article-stats {
    font-size: 0.9rem;
    color: var(--secondary-color);
}

.article-stats i {
    margin-right: 4px;
}

/* Editor de Markdown */
.markdown-editor {
    min-height: 400px;
    border: 1px solid #ced4da;
    border-radius: 0.375rem;
}

.markdown-toolbar {
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    padding: 8px 12px;
}

.markdown-toolbar button {
    background: none;
    border: none;
    padding: 4px 8px;
    margin-right: 4px;
    border-radius: 4px;
    cursor: pointer;
}

.markdown-toolbar button:hover {
    background-color: #e9ecef;
}

.markdown-preview {
    padding: 12px;
    min-height: 350px;
    background-color: white;
}

.markdown-input {
    border: none;
    outline: none;
    resize: none;
    padding: 12px;
    min-height: 350px;
    font-family: 'Courier New', monospace;
}

/* Tabs do editor */
.editor-tabs {
    border-bottom: 1px solid #dee2e6;
}

.editor-tabs .nav-link {
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--secondary-color);
}

.editor-tabs .nav-link.active {
    border-bottom-color: var(--primary-color);
    color: var(--primary-color);
}

/* Referências de artigos */
.article-reference {
    background-color: #e7f3ff;
    padding: 2px 6px;
    border-radius: 4px;
    text-decoration: none;
    color: var(--primary-color);
    border: 1px solid #b3d9ff;
}

.article-reference:hover {
    background-color: #d1ecf1;
    color: var(--primary-color);
}

/* Questões */
.question-card {
    border-left: 4px solid var(--primary-color);
}

.question-option {
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 6px;
    transition: background-color 0.2s;
}

.question-option:hover {
    background-color: #f8f9fa;
}

.question-option.correct {
    background-color: #d1e7dd;
    border: 1px solid #badbcc;
}

.question-option.incorrect {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
}

/* Perfil */
.profile-header {
    background: linear-gradient(135deg, var(--primary-color), var(--info-color));
    color: white;
    padding: 2rem 0;
}

.profile-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid white;
}

/* Comunidades */
.community-header {
    position: relative;
    height: 200px;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: end;
}

.community-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, transparent, rgba(0,0,0,0.7));
}

.community-info {
    position: relative;
    z-index: 1;
    color: white;
    padding: 2rem;
}

.community-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid white;
}

/* Árvore de pastas */
.folder-tree {
    list-style: none;
    padding-left: 0;
}

.folder-tree li {
    margin: 4px 0;
}

.folder-tree .folder-item {
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
}

.folder-tree .folder-item:hover {
    background-color: #f8f9fa;
}

.folder-tree .folder-item i {
    margin-right: 8px;
    width: 16px;
}

.folder-tree .subfolder {
    margin-left: 20px;
    border-left: 1px dashed #dee2e6;
    padding-left: 12px;
}

/* Responsividade */
@media (max-width: 768px) {
    .community-header {
        height: 150px;
    }
    
    .community-info {
        padding: 1rem;
    }
    
    .profile-avatar {
        width: 80px;
        height: 80px;
    }
    
    .community-avatar {
        width: 60px;
        height: 60px;
    }
}

/* Animações */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

/* Loading */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Badges customizados */
.badge-views {
    background-color: var(--info-color);
}

.badge-likes {
    background-color: var(--danger-color);
}

.badge-comments {
    background-color: var(--success-color);
}

/* Botões customizados */
.btn-like {
    border: none;
    background: none;
    color: var(--secondary-color);
    transition: color 0.2s;
}

.btn-like:hover {
    color: var(--danger-color);
}

.btn-like.liked {
    color: var(--danger-color);
}

/* Formulários */
.form-floating > label {
    color: var(--secondary-color);
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* Alertas customizados */
.alert-custom {
    border: none;
    border-radius: 8px;
    padding: 1rem 1.25rem;
}

/* Dropdown customizado */
.dropdown-menu {
    border: none;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border-radius: 8px;
}

.dropdown-item:hover {
    background-color: #f8f9fa;
}

/* Paginação */
.pagination .page-link {
    border: none;
    color: var(--primary-color);
}

.pagination .page-item.active .page-link {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* Tooltips */
.tooltip-inner {
    background-color: #333;
    color: white;
    border-radius: 4px;
}

/* Modais */
.modal-content {
    border: none;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.modal-header {
    border-bottom: 1px solid #e9ecef;
    padding: 1.5rem;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    border-top: 1px solid #e9ecef;
    padding: 1.5rem;
}