/* Estilos para o sistema de documentos multimídia */

.documentos-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.page-header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: linear-gradient(135deg, #4d5da4 0%, #1a1946 100%);
    color: white;
    border-radius: 10px;
}

.page-header h1 {
    margin: 0 0 10px 0;
    font-size: 2.5em;
    font-weight: 300;
}

.page-header p {
    margin: 0;
    opacity: 0.9;
    font-size: 1.1em;
}

/* Alertas */
.alert {
    padding: 15px 20px;
    margin-bottom: 20px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Layout principal */
.main-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

/* Cards */
.card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.card-header {
    background: #f8f9fa;
    padding: 20px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h2 {
    margin: 0;
    color: #495057;
    font-size: 1.3em;
    font-weight: 600;
}

.card-body {
    padding: 25px;
}

/* Formulários */
.form-group {
    margin-bottom: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #495057;
    font-size: 0.95em;
}

.form-group label i {
    margin-right: 8px;
    color: #6c757d;
    width: 16px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1em;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

/* Input de arquivo customizado */
.file-input-wrapper {
    position: relative;
}

.file-input-wrapper input[type="file"] {
    padding: 15px;
    border: 2px dashed #dee2e6;
    background: #f8f9fa;
    cursor: pointer;
}

.file-input-wrapper input[type="file"]:hover {
    border-color: #667eea;
    background: #f0f2ff;
}

.file-info {
    margin-top: 10px;
}

.file-types {
    display: flex;
    gap: 15px;
    margin-bottom: 5px;
}

.file-type {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.9em;
    color: #6c757d;
}

.file-limits {
    color: #6c757d;
    font-size: 0.85em;
}

/* Botões */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    justify-content: center;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #151431 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    color: #6c757d;
    border: 2px solid #dee2e6;
}

.btn-outline:hover {
    background: #f8f9fa;
    border-color: #adb5bd;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.9em;
}

/* Ações do formulário */
.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 25px;
}

/* Toggle de visualização */
.view-toggle {
    display: flex;
    gap: 5px;
}

.view-toggle .btn.active {
    background: #667eea;
    color: white;
}

.count {
    font-weight: normal;
    color: #6c757d;
    font-size: 0.9em;
}

/* Grid de documentos */
.documents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.documents-grid.list-view {
    grid-template-columns: 1fr;
}

.documents-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.document-card {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.2s ease;
    position: relative;
}

.document-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border-color: #667eea;
}

.document-preview {
    height: 200px;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.document-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-preview,
.document-preview-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    color: #6c757d;
}

.video-preview i,
.document-preview-icon i {
    font-size: 3em;
}

.video-preview {
    color: #dc3545;
}

.document-preview-icon {
    color: #28a745;
}

.document-info {
    padding: 20px;
}

.document-info h3 {
    margin: 0 0 10px 0;
    font-size: 1.1em;
    font-weight: 600;
    color: #212529;
    line-height: 1.3;
}

.document-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 0.9em;
}

.category {
    background: #e9ecef;
    color: #495057;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8em;
    font-weight: 600;
}

.date {
    color: #6c757d;
}

.description {
    color: #6c757d;
    font-size: 0.9em;
    line-height: 1.4;
    margin: 10px 0;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 10px;
}

.tag {
    background: #667eea;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75em;
    font-weight: 500;
}

.document-actions {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 5px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.document-card:hover .document-actions {
    opacity: 1;
}

/* Estado vazio */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
}

.empty-state i {
    font-size: 4em;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state h3 {
    margin: 0 0 10px 0;
    font-size: 1.5em;
    font-weight: 300;
}

.empty-state p {
    margin: 0;
    font-size: 1.1em;
}

/* Visualização em lista */
.documents-grid.list-view .document-card {
    display: flex;
    align-items: stretch;
}

.documents-grid.list-view .document-preview {
    width: 150px;
    height: 100px;
    flex-shrink: 0;
}

.documents-grid.list-view .document-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.documents-grid.list-view .document-actions {
    padding: 1rem;
    align-self: center;
}

/* Seção de Documentos */
.documents-section {
    margin-top: 30px;
}

.document-count {
    background: #e9ecef;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.9em;
    color: #495057;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
}

.empty-state i {
    color: #dee2e6;
    margin-bottom: 20px;
}

.empty-state h3 {
    margin: 0 0 10px 0;
    color: #495057;
}

.documents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.document-card {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.document-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.document-icon {
    text-align: center;
    font-size: 2.5em;
    color: #4d5da4;
}

.document-info h4 {
    margin: 0 0 10px 0;
    color: #2c3e50;
    font-size: 1.1em;
    font-weight: 600;
}

.document-meta {
    display: flex;
    justify-content: space-between;
    margin: 5px 0;
    font-size: 0.9em;
}

.category {
    background: #4d5da4;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8em;
}

.date {
    color: #6c757d;
}

.document-user, .document-size {
    margin: 5px 0;
    font-size: 0.9em;
    color: #6c757d;
}

.document-actions {
    display: flex;
    gap: 10px;
    margin-top: auto;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.875em;
    border-radius: 4px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.3s ease;
}

.btn-sm.btn-primary {
    background: #4d5da4;
    color: white;
    border: 1px solid #4d5da4;
}

.btn-sm.btn-primary:hover {
    background: #3d4a84;
}

.btn-sm.btn-secondary {
    background: #6c757d;
    color: white;
    border: 1px solid #6c757d;
}

.btn-sm.btn-secondary:hover {
    background: #5a6268;
}

/* Responsividade */
@media (max-width: 768px) {
    .documentos-container {
        padding: 15px;
    }
    
    .main-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .documents-grid {
        grid-template-columns: 1fr;
    }
    
    .page-header h1 {
        font-size: 2em;
    }
    
    .card-body {
        padding: 20px;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .view-toggle {
        margin-top: 10px;
    }
    
    .document-actions {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .documentos-container {
        padding: 10px;
    }
    
    .page-header {
        padding: 15px;
    }
    
    .page-header h1 {
        font-size: 1.8em;
    }
    
    .card-header,
    .card-body {
        padding: 15px;
    }
    
    .document-preview {
        height: 150px;
    }
}

/* Animações */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.document-card {
    animation: fadeIn 0.3s ease;
}

/* Melhorias para acessibilidade */
.btn:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* Indicadores de tipo de arquivo */
.document-card[data-tipo="imagem"] {
    border-left: 4px solid #28a745;
}

.document-card[data-tipo="video"] {
    border-left: 4px solid #dc3545;
}

.document-card[data-tipo="documento"] {
    border-left: 4px solid #007bff;
}