/* ============================================
   MODAL DE GERENCIAMENTO DE DOCUMENTOS
   ============================================ */

.documents-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

.documents-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.documents-modal-content {
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

.documents-modal-header {
    padding: 24px 32px;
    border-bottom: 1px solid #e5e5e5;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    background: white;
    z-index: 1;
}

.documents-modal-header h2 {
    font-size: 1.5rem;
    color: #1a1a1a;
    display: flex;
    align-items: center;
    gap: 12px;
}

.documents-modal-header .close-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: #f3f4f6;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.documents-modal-header .close-btn:hover {
    background: #e5e7eb;
    transform: rotate(90deg);
}

.documents-modal-body {
    padding: 32px;
}

.document-upload-area {
    border: 2px dashed #e5e5e5;
    border-radius: 12px;
    padding: 32px;
    text-align: center;
    background: #fafafa;
    transition: all 0.3s ease;
    margin-bottom: 32px;
    cursor: pointer;
}

.document-upload-area.dragover {
    border-color: #3b82f6;
    background: #eff6ff;
}

.document-upload-area input[type="file"] {
    display: none;
}

.document-upload-label {
    cursor: pointer;
    display: block;
}

.document-upload-label i {
    font-size: 3rem;
    color: #d97706;
    margin-bottom: 16px;
    display: block;
}

.document-upload-label h3 {
    font-size: 1.2rem;
    color: #1a1a1a;
    margin-bottom: 8px;
}

.document-upload-label p {
    color: #666666;
    font-size: 0.9rem;
}

.document-form {
    display: none;
    background: white;
    border: 1px solid #e5e5e5;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
}

.document-form.active {
    display: block;
    animation: slideUp 0.3s ease;
}

.document-form-group {
    margin-bottom: 20px;
}

.document-form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #1a1a1a;
}

.document-form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.document-form-group input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.document-form-preview {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #f9fafb;
    border-radius: 8px;
    margin-bottom: 16px;
}

.document-form-preview i {
    font-size: 2rem;
    color: #dc2626;
}

.document-form-preview-info {
    flex: 1;
}

.document-form-preview-info .filename {
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 4px;
}

.document-form-preview-info .filesize {
    font-size: 0.85rem;
    color: #666666;
}

.document-form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

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

.documents-list-empty {
    text-align: center;
    padding: 48px 24px;
    color: #666666;
}

.documents-list-empty i {
    font-size: 3rem;
    color: #e5e7eb;
    margin-bottom: 16px;
    display: block;
}

.document-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: white;
    border: 1px solid #e5e5e5;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.document-item:hover {
    box-shadow: 0 1px 8px rgba(0, 0, 0, 0.06);
    border-color: #d1d5db;
}

.document-item-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fef3c7;
    border-radius: 10px;
    flex-shrink: 0;
}

.document-item-icon i {
    font-size: 1.5rem;
    color: #d97706;
}

.document-item-info {
    flex: 1;
    min-width: 0;
}

.document-item-title {
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.document-item-meta {
    font-size: 0.85rem;
    color: #666666;
    display: flex;
    gap: 16px;
}

.document-item-actions {
    display: flex;
    gap: 8px;
}

.document-item-actions button {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.document-item-actions .btn-download {
    background: #dbeafe;
    color: #1e40af;
}

.document-item-actions .btn-download:hover {
    background: #3b82f6;
    color: white;
}

.document-item-actions .btn-delete-doc {
    background: #fee2e2;
    color: #dc2626;
}

.document-item-actions .btn-delete-doc:hover {
    background: #dc2626;
    color: white;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ============================================
   RESPONSIVIDADE
   ============================================ */

@media (max-width: 768px) {
    .documents-modal-content {
        width: 100%;
        max-width: 100%;
        max-height: 100vh;
        border-radius: 0;
    }

    .documents-modal-header {
        padding: 20px;
    }

    .documents-modal-header h2 {
        font-size: 1.2rem;
    }

    .documents-modal-body {
        padding: 20px;
    }

    .document-upload-area {
        padding: 24px;
    }

    .document-upload-label i {
        font-size: 2.5rem;
    }

    .document-upload-label h3 {
        font-size: 1rem;
    }

    .document-form {
        padding: 16px;
    }

    .document-form-actions {
        flex-direction: column;
    }

    .document-form-actions button {
        width: 100%;
    }

    .document-item {
        padding: 12px;
        flex-wrap: wrap;
    }

    .document-item-info {
        width: 100%;
        margin-bottom: 12px;
    }

    .document-item-meta {
        flex-direction: column;
        gap: 4px;
    }

    .document-item-actions {
        width: 100%;
        justify-content: flex-end;
    }
}

@media (max-width: 480px) {
    .documents-modal-header {
        padding: 16px;
    }

    .documents-modal-header h2 {
        font-size: 1.1rem;
        gap: 8px;
    }

    .documents-modal-body {
        padding: 16px;
    }

    .document-upload-area {
        padding: 20px;
    }

    .document-upload-label i {
        font-size: 2rem;
        margin-bottom: 12px;
    }

    .document-upload-label h3 {
        font-size: 0.95rem;
    }

    .document-upload-label p {
        font-size: 0.85rem;
    }

    .document-form-group label {
        font-size: 0.9rem;
    }

    .document-form-group input {
        padding: 10px;
        font-size: 0.9rem;
    }

    .document-item-icon {
        width: 40px;
        height: 40px;
    }

    .document-item-icon i {
        font-size: 1.2rem;
    }

    .document-item-title {
        font-size: 0.9rem;
    }

    .document-item-meta {
        font-size: 0.8rem;
    }
}
