/* Estilos personalizados para Veritas */
:root {
    --primary-color: #0d6efd;
    --primary-dark: #0b5ed7;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
}

body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.card {
    border-radius: 15px;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95);
}

.card-body {
    padding: 2.5rem !important;
}

.form-control {
    border-radius: 8px;
    border: 1px solid #dee2e6;
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
    transform: translateY(-2px);
}

.input-group-text {
    border-radius: 8px 0 0 8px;
    border: 1px solid #dee2e6;
    background: #f8f9fa;
}

.btn {
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(45deg, var(--primary-color), var(--primary-dark));
    border: none;
    box-shadow: 0 4px 15px rgba(13, 110, 253, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(13, 110, 253, 0.4);
}

.btn-primary:disabled {
    opacity: 0.7;
    transform: none;
}

.alert {
    border-radius: 8px;
    border: none;
    margin-bottom: 1.5rem;
}

.text-primary {
    color: var(--primary-color) !important;
}

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

.card {
    animation: fadeIn 0.6s ease-out;
}

/* Loading spinner */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

/* Responsive */
@media (max-width: 576px) {
    .card-body {
        padding: 2rem !important;
    }
    
    .container-fluid {
        padding: 1rem;
    }
}

/* Toggle password button */
#toggle-password {
    border-left: none;
    border-radius: 0 8px 8px 0;
}

/* Icons */
.fa-shield-alt {
    background: linear-gradient(45deg, var(--primary-color), var(--primary-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}



/* Quick Action Buttons */
.btn[data-section] {
    transition: all 0.3s ease;
}

.btn[data-section]:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

/* Card improvements */
.card {
    transition: all 0.3s ease;
    border-radius: 12px;
}

.card:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1) !important;
}

.card-header {
    border-radius: 12px 12px 0 0 !important;
    font-weight: 600;
}

/* Dropdown improvements */
.dropdown-menu {
    border-radius: 8px;
    border: none;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    margin-top: 0.5rem;
}

.dropdown-item {
    padding: 0.75rem 1rem;
    transition: background-color 0.3s ease;
}

.dropdown-item:hover {
    background-color: #f8f9fa;
}

/* Animations */
@keyframes slideInLeft {
    from { transform: translateX(-100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

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

.content-section.active {
    animation: slideInUp 0.5s ease-out;
}

/* Loading states */
.loading {
    opacity: 0.7;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Gallery Styles */
.file-item {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

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

.file-item.selected {
    ring: 3px solid var(--primary-color);
    background: rgba(13, 110, 253, 0.05);
}

.file-thumbnail {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
}

.file-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.file-item:hover .file-thumbnail img {
    transform: scale(1.05);
}

.file-icon {
    font-size: 3rem;
    color: #6c757d;
}

.file-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.file-item:hover .file-overlay {
    opacity: 1;
}

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

.file-actions .btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.file-actions .btn:hover {
    transform: scale(1.1);
}

.file-info {
    padding: 15px;
}

.file-name {
    font-weight: 600;
    color: #212529;
    margin-bottom: 5px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-details {
    margin-bottom: 8px;
}

.file-tags {
    color: var(--primary-color);
    font-size: 0.85rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Upload Modal */
.file-preview {
    padding: 10px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    margin-bottom: 10px;
    background: #f8f9fa;
}

.file-preview:hover {
    background: #e9ecef;
}

/* Gallery Grid Responsive */
@media (max-width: 576px) {
    .file-thumbnail {
        height: 150px;
    }
    
    .file-actions {
        flex-wrap: wrap;
        gap: 5px;
    }
    
    .file-actions .btn {
        width: 35px;
        height: 35px;
        font-size: 0.8rem;
    }
}

/* Loading states for gallery */
.gallery-loading .file-item {
    opacity: 0.6;
    pointer-events: none;
}

/* Image Modal */
#imageModal .modal-dialog {
    max-width: 90vw;
    margin: 2rem auto;
}

#imageModal .modal-body {
    padding: 0;
}

#imageModalImg {
    max-height: 80vh;
    width: auto;
    border-radius: 0 0 12px 12px;
}

/* File type indicators */
.file-item[data-type="image"] {
    border-left: 4px solid #007bff;
}

.file-item[data-type="video"] {
    border-left: 4px solid #28a745;
}

.file-item[data-type="document"] {
    border-left: 4px solid #ffc107;
}

.file-item[data-type="other"] {
    border-left: 4px solid #6c757d;
}

/* Pagination */
.pagination .page-link {
    border-radius: 8px;
    margin: 0 2px;
    border: none;
    color: var(--primary-color);
}

.pagination .page-item.active .page-link {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.pagination .page-link:hover {
    background: rgba(13, 110, 253, 0.1);
}

/* Bulk actions */
#bulk-actions .alert {
    border-radius: 12px;
    border: none;
    background: linear-gradient(135deg, #d1ecf1 0%, #bee5eb 100%);
}

/* Search and filter improvements */
.input-group .input-group-text {
    background: white;
    border-right: none;
}

.input-group .form-control {
    border-left: none;
}

.input-group .form-control:focus {
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
    border-color: var(--primary-color);
}

.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}
/* Dashboard Styles - SIDEBAR CORREGIDA */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 280px;
    background: linear-gradient(180deg, #1a1d29 0%, #2d3748 100%);
    transform: translateX(-280px);
    transition: transform 0.3s ease;
    z-index: 1050;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.sidebar.show {
    transform: translateX(0);
}

/* Responsive Design - CORREGIDA */
@media (min-width: 992px) {
    .sidebar {
        position: fixed;
        transform: translateX(0);
        z-index: 1050;
    }
    
    .main-content {
        margin-left: 280px;
        width: calc(100% - 280px);
    }
    
    /* Para ocultar sidebar en desktop */
    .sidebar.hide {
        transform: translateX(-280px);
    }
    
    .main-content.sidebar-collapsed {
        margin-left: 0;
        width: 100%;
    }
}

@media (max-width: 991.98px) {
    .sidebar {
        width: 100%;
        transform: translateX(-100%);
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
        width: 100%;
    }
}

/* Mejoras adicionales para layout desktop/mobile */
.main-content {
    transition: margin-left 0.3s ease, width 0.3s ease;
    min-height: 100vh;
    position: relative;
}

/* Asegurar que el contenido sea visible */
.content-section {
    opacity: 1;
    transition: opacity 0.3s ease;
}

/* Mejorar overlay en mobile */
.sidebar-overlay {
    transition: all 0.3s ease;
}

/* Body scroll management */
body.sidebar-open {
    overflow: hidden;
}

/* Fix para navegación en desktop */
@media (min-width: 992px) {
    .navbar {
        transition: all 0.3s ease;
    }
    
    .sidebar-collapsed .navbar {
        padding-left: 1rem;
    }
}

/* Debug helpers - remover en producción */
.debug-desktop {
    display: none;
}

@media (min-width: 992px) {
    .debug-desktop {
        display: block;
        position: fixed;
        top: 10px;
        right: 10px;
        background: rgba(0,0,0,0.8);
        color: white;
        padding: 5px;
        font-size: 12px;
        z-index: 9999;
    }
}
