/* ========================================
   Estilos para Subir Imágenes de Disparo
   ======================================== */

:root {
    --primary-color: #667eea;
    --primary-dark: #5a6fd6;
    --secondary-color: #764ba2;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --info-color: #17a2b8;
}

body {
    background-color: #f4f6f9;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Navbar */
.navbar {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%) !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* Cards */
.card {
    border: none;
    border-radius: 15px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1) !important;
}

/* Upload Box */
.upload-box {
    border: 3px dashed var(--primary-color);
    border-radius: 15px;
    padding: 60px 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, #f8f9ff 0%, #f0f4ff 100%);
}

.upload-box:hover,
.upload-box.hover {
    background: linear-gradient(135deg, #e8edff 0%, #dde5ff 100%);
    border-color: var(--secondary-color);
    transform: scale(1.01);
}

.upload-box.dragover {
    background: linear-gradient(135deg, #d4ddff 0%, #c8d4ff 100%);
    border-color: var(--success-color);
    border-style: solid;
}

.upload-box .icon {
    font-size: 80px;
    color: var(--primary-color);
    margin-bottom: 20px;
    display: block;
}

.upload-box p {
    margin: 0;
    color: #6c757d;
    font-size: 1.1rem;
}

.upload-box small {
    display: block;
    margin-top: 10px;
}

/* Botones */
.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border: none;
    border-radius: 25px;
    padding: 12px 30px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--primary-dark) 0%, #6a4190 100%);
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-success {
    border-radius: 25px;
    padding: 10px 25px;
    font-weight: 500;
}

/* Progress bars */
.progress {
    border-radius: 15px;
    overflow: hidden;
    background-color: #e9ecef;
}

.progress-bar {
    border-radius: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Disk usage colors */
.progress-bar.bg-info {
    background: linear-gradient(90deg, #17a2b8, #20c997) !important;
}

.progress-bar.bg-success {
    background: linear-gradient(90deg, #28a745, #34ce57) !important;
}

.progress-bar.bg-warning {
    background: linear-gradient(90deg, #ffc107, #ffca2c) !important;
}

.progress-bar.bg-danger {
    background: linear-gradient(90deg, #dc3545, #e4606d) !important;
}

/* File list */
#file-list-content {
    border-radius: 10px;
}

#file-list-content .list-group-item {
    border-left: none;
    border-right: none;
    padding: 10px 15px;
}

#file-list-content .list-group-item:first-child {
    border-top: none;
    border-radius: 10px 10px 0 0;
}

#file-list-content .list-group-item:last-child {
    border-bottom: none;
    border-radius: 0 0 10px 10px;
}

/* Success popup */
.success-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, var(--success-color) 0%, #20c997 100%);
    color: white;
    padding: 30px 50px;
    border-radius: 15px;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 15px;
    opacity: 1;
    transition: opacity 0.3s ease;
    box-shadow: 0 10px 40px rgba(40, 167, 69, 0.4);
    z-index: 9999;
}

.success-popup i {
    font-size: 2rem;
}

/* Toast */
.toast {
    border-radius: 10px;
}

/* Session timer */
#session-timer {
    font-weight: 600;
    color: var(--primary-color);
}

/* Animations */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.uploading .upload-box {
    animation: pulse 1.5s infinite;
}

/* Responsive */
@media (max-width: 768px) {
    .upload-box {
        padding: 40px 20px;
    }
    
    .upload-box .icon {
        font-size: 60px;
    }
    
    .success-popup {
        padding: 20px 30px;
        font-size: 1rem;
    }
}

/* ==========================================
   File Manager Styles
   ========================================== */

/* Contenedor con scroll */
.file-manager-wrapper {
    height: calc(100vh - 380px);
    min-height: 350px;
    max-height: 600px;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Scrollbar personalizado */
.file-manager-wrapper::-webkit-scrollbar {
    width: 10px;
}

.file-manager-wrapper::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 5px;
}

.file-manager-wrapper::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 5px;
}

.file-manager-wrapper::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

.file-manager-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 15px;
    min-height: 300px;
}

.file-item {
    background: #fff;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 15px 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.file-item:hover {
    border-color: var(--primary-color);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.file-item.selected {
    border-color: var(--primary-color);
    background: #f0f4ff;
}

.file-item .file-icon {
    font-size: 48px;
    margin-bottom: 10px;
    display: block;
}

.file-item .file-icon.folder {
    color: #ffc107;
}

.file-item .file-icon.image {
    color: #28a745;
}

.file-item .file-icon.document {
    color: #dc3545;
}

.file-item .file-icon.archive {
    color: #6c757d;
}

.file-item .file-icon.excel {
    color: #217346;
}

.file-item .file-name {
    font-size: 0.85rem;
    word-break: break-word;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    max-height: 2.6em;
}

.file-item .file-path {
    font-size: 0.65rem;
    color: #999;
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-item .file-size {
    font-size: 0.7rem;
    color: #6c757d;
    margin-top: 5px;
}

/* Checkbox de selección */
.file-item .file-checkbox {
    position: absolute;
    top: 8px;
    left: 8px;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 10;
    cursor: pointer;
}

.file-item:hover .file-checkbox,
.file-item.selected .file-checkbox {
    opacity: 1;
}

.file-item .file-checkbox input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--primary-color);
    margin: 0;
}

/* Contenido clickeable del archivo */
.file-item .file-content {
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Estado seleccionado */
.file-item.selected {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, #f0f4ff 0%, #e8edff 100%);
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.3);
}

.file-item.selected .file-checkbox {
    opacity: 1;
}

.file-item .file-actions {
    position: absolute;
    top: 5px;
    right: 5px;
    display: none;
    z-index: 15;
}

.file-item:hover .file-actions {
    display: block;
}

.file-item .file-actions .btn {
    padding: 2px 6px;
    font-size: 0.7rem;
}

.file-item .file-thumbnail {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 10px;
}

/* Barra de herramientas de selección */
.selection-toolbar {
    background: linear-gradient(135deg, #f8f9ff 0%, #f0f4ff 100%);
    border-radius: 8px;
    padding: 10px 15px;
    border: 1px solid #e0e5ff;
    animation: slideDown 0.2s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Breadcrumb */
#file-breadcrumb {
    background: transparent;
    padding: 0;
}

#file-breadcrumb .breadcrumb-item a {
    color: var(--primary-color);
    text-decoration: none;
}

#file-breadcrumb .breadcrumb-item a:hover {
    text-decoration: underline;
}

/* Search input styling */
.search-input-group {
    transition: all 0.3s ease;
}

.search-input-group:focus-within {
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
    border-radius: 6px;
}

.search-input-group .input-group-text {
    border-color: #ced4da;
}

.search-input-group .form-control:focus {
    box-shadow: none;
    border-color: var(--primary-color);
}

.search-input-group .form-control {
    border-color: #ced4da;
}

/* Context menu */
.context-menu {
    position: fixed;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
    z-index: 9999;
    min-width: 150px;
}

.context-menu-item {
    padding: 8px 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
}

.context-menu-item:hover {
    background: #f8f9fa;
}

.context-menu-item:first-child {
    border-radius: 8px 8px 0 0;
}

.context-menu-item:last-child {
    border-radius: 0 0 8px 8px;
}

.context-menu-divider {
    border-top: 1px solid #eee;
    margin: 5px 0;
}

/* Empty state */
.file-manager-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    color: #6c757d;
    grid-column: 1 / -1;
}

.file-manager-empty i {
    font-size: 64px;
    margin-bottom: 15px;
    opacity: 0.5;
}

/* Loading */
.file-manager-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    grid-column: 1 / -1;
}

.file-manager-loading p {
    margin-top: 10px;
    color: #6c757d;
}

/* Loading more indicator (for lazy loading) */
.file-manager-loading-more {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 15px;
    color: #6c757d;
    font-size: 0.85rem;
    grid-column: 1 / -1;
}

/* Tabs */
.nav-tabs .nav-link {
    color: #6c757d;
    border: none;
    padding: 12px 20px;
    font-weight: 500;
}

.nav-tabs .nav-link.active {
    color: var(--primary-color);
    border-bottom: 3px solid var(--primary-color);
    background: transparent;
}

.nav-tabs .nav-link:hover:not(.active) {
    color: var(--primary-dark);
    border-color: transparent;
}
