/* ============================================
   NeoFolder Features - Global CSS
   ============================================ */

/* ---- Dark Mode Toggle ---- */
.dark-mode-toggle {
    cursor: pointer;
    border: none;
    background: none;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background 0.2s;
    font-size: 1.2rem;
    line-height: 1;
}
.dark-mode-toggle:hover {
    background: rgba(0,0,0,0.08);
}
[data-bs-theme=dark] .dark-mode-toggle:hover {
    background: rgba(255,255,255,0.1);
}

/* ---- Skeleton Loaders ---- */
.skeleton {
    background: linear-gradient(90deg, #e9ecef 25%, #f8f9fa 50%, #e9ecef 75%);
    background-size: 200% 100%;
    animation: skeleton-pulse 1.5s infinite;
    border-radius: 6px;
    min-height: 20px;
}
[data-bs-theme=dark] .skeleton {
    background: linear-gradient(90deg, #2c3034 25%, #373b3e 50%, #2c3034 75%);
    background-size: 200% 100%;
}
@keyframes skeleton-pulse {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
.skeleton-card {
    height: 120px;
}
.skeleton-chart {
    height: 250px;
}
.skeleton-row {
    height: 40px;
    margin-bottom: 8px;
}
.skeleton-text {
    height: 14px;
    width: 60%;
    margin-bottom: 8px;
}
.skeleton-text-short {
    height: 14px;
    width: 30%;
}

/* ---- Empty States ---- */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
}
.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.4;
}
.empty-state h5 {
    font-weight: 600;
    margin-bottom: 10px;
    color: #495057;
}
[data-bs-theme=dark] .empty-state h5 {
    color: #dee2e6;
}
.empty-state p {
    font-size: 0.9rem;
    max-width: 400px;
    margin: 0 auto 20px;
}

/* ---- Global Search ---- */
.global-search-wrapper {
    position: relative;
    max-width: 400px;
    width: 100%;
}
.global-search-input {
    padding-left: 36px !important;
    border-radius: 20px !important;
    font-size: 0.85rem;
    border: 1px solid #dee2e6;
    transition: box-shadow 0.2s, border-color 0.2s;
}
.global-search-input:focus {
    box-shadow: 0 0 0 3px rgba(21,163,98,0.15);
    border-color: #15a362;
}
.global-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
    pointer-events: none;
}
.search-results-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 12px;
    margin-top: 4px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    z-index: 1060;
    max-height: 400px;
    overflow-y: auto;
    display: none;
}
[data-bs-theme=dark] .search-results-dropdown {
    background: #212529;
    border-color: #495057;
}
.search-results-dropdown.show {
    display: block;
}
.search-result-item {
    padding: 10px 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.15s;
}
.search-result-item:hover {
    background: #f8f9fa;
}
[data-bs-theme=dark] .search-result-item:hover {
    background: #2c3034;
}
.search-result-item:last-child {
    border-bottom: none;
}
.search-result-icon {
    font-size: 1.4rem;
    opacity: 0.6;
    flex-shrink: 0;
}
.search-result-info {
    flex: 1;
    min-width: 0;
}
.search-result-name {
    font-weight: 500;
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.search-result-meta {
    font-size: 0.75rem;
    color: #6c757d;
}
.search-no-results {
    padding: 20px;
    text-align: center;
    color: #6c757d;
    font-size: 0.85rem;
}

/* ---- Drag & Drop Upload ---- */
.dropzone-area {
    border: 2px dashed #dee2e6;
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: #fafbfc;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.dropzone-area:hover,
.dropzone-area.dragover {
    border-color: #15a362;
    background: rgba(21,163,98,0.05);
}
.dropzone-area.dragover {
    transform: scale(1.01);
}
[data-bs-theme=dark] .dropzone-area {
    background: #1a1d21;
    border-color: #495057;
}
.dropzone-icon {
    font-size: 3rem;
    color: #15a362;
    margin-bottom: 12px;
}
.dropzone-text {
    font-size: 0.95rem;
    color: #6c757d;
    margin-bottom: 4px;
}
.dropzone-hint {
    font-size: 0.8rem;
    color: #adb5bd;
}

/* ---- Upload Progress Per File ---- */
.upload-file-list {
    max-height: 300px;
    overflow-y: auto;
}
.upload-file-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    margin-bottom: 6px;
    font-size: 0.82rem;
}
.upload-file-item .file-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}
.upload-file-item .file-info {
    flex: 1;
    min-width: 0;
}
.upload-file-item .file-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
}
.upload-file-item .file-size {
    font-size: 0.72rem;
    color: #6c757d;
}
.upload-file-item .file-progress {
    width: 100%;
    height: 4px;
    border-radius: 2px;
    margin-top: 4px;
}
.upload-file-item .btn-cancel {
    flex-shrink: 0;
    font-size: 0.75rem;
}
.upload-file-item.upload-success {
    border-color: #198754;
    background: rgba(25,135,84,0.03);
}
.upload-file-item.upload-error {
    border-color: #dc3545;
    background: rgba(220,53,69,0.03);
}

/* ---- Tags / Etiquetas ---- */
.tag-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 500;
    background: #e8f5e9;
    color: #2e7d32;
    margin: 1px 2px;
    white-space: nowrap;
}
[data-bs-theme=dark] .tag-badge {
    background: #1b3a1b;
    color: #81c784;
}
.tag-badge .tag-remove {
    cursor: pointer;
    opacity: 0.6;
    font-size: 0.6rem;
    margin-left: 2px;
}
.tag-badge .tag-remove:hover {
    opacity: 1;
}
.tag-input-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 4px 8px;
    min-height: 36px;
    cursor: text;
}
.tag-input-wrapper input {
    border: none;
    outline: none;
    flex: 1;
    min-width: 80px;
    font-size: 0.82rem;
    background: transparent;
}

/* ---- Batch Actions Bar ---- */
.batch-actions-bar {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #212529;
    color: #fff;
    padding: 10px 24px;
    border-radius: 12px;
    display: none;
    align-items: center;
    gap: 16px;
    z-index: 1050;
    box-shadow: 0 8px 32px rgba(0,0,0,0.25);
    font-size: 0.85rem;
}
.batch-actions-bar.show {
    display: flex;
}
.batch-actions-bar .batch-count {
    font-weight: 600;
    margin-right: 8px;
}
.batch-actions-bar .btn {
    font-size: 0.8rem;
    padding: 4px 12px;
}

/* ---- Date Alert Badges ---- */
.date-alert-expiring {
    color: #dc3545;
    font-weight: 600;
}
.date-alert-warning {
    color: #ffc107;
    font-weight: 600;
}
.date-alert-ok {
    color: #198754;
}
.alert-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 4px;
}
.alert-dot-red { background: #dc3545; }
.alert-dot-yellow { background: #ffc107; }
.alert-dot-green { background: #198754; }

/* ---- Multi-format Preview ---- */
.preview-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border-radius: 8px;
    overflow: hidden;
}
[data-bs-theme=dark] .preview-container {
    background: #1a1d21;
}
.preview-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}
.preview-container video,
.preview-container audio {
    max-width: 100%;
}
.preview-unsupported {
    text-align: center;
    padding: 40px;
    color: #6c757d;
}
.preview-unsupported i {
    font-size: 3rem;
    display: block;
    margin-bottom: 12px;
}

/* ---- Breadcrumbs ---- */
.neo-breadcrumb {
    font-size: 0.82rem;
    padding: 8px 0;
    margin-bottom: 8px;
}
.neo-breadcrumb .breadcrumb-item a {
    color: #15a362;
    text-decoration: none;
}
.neo-breadcrumb .breadcrumb-item.active {
    color: #6c757d;
}

/* ---- Keyboard Shortcuts Modal ---- */
.shortcut-key {
    display: inline-block;
    padding: 2px 8px;
    background: #e9ecef;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.8rem;
    font-weight: 600;
    min-width: 28px;
    text-align: center;
}
[data-bs-theme=dark] .shortcut-key {
    background: #343a40;
    border-color: #495057;
}
.shortcuts-list {
    list-style: none;
    padding: 0;
}
.shortcuts-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.85rem;
}

/* ---- Notification Badge Pulse ---- */
.icon-badge {
    position: relative;
}
.icon-badge.has-new::after {
    content: '';
    position: absolute;
    top: -2px;
    right: -2px;
    width: 8px;
    height: 8px;
    background: #dc3545;
    border-radius: 50%;
    animation: badge-pulse 2s infinite;
}
@keyframes badge-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ---- Export Buttons ---- */
.export-btn-group .btn {
    font-size: 0.78rem;
    padding: 4px 10px;
}

/* ---- Version History ---- */
.version-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    border-left: 3px solid #dee2e6;
    margin-left: 12px;
    margin-bottom: 0;
    position: relative;
}
.version-item::before {
    content: '';
    position: absolute;
    left: -7px;
    top: 16px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #15a362;
    border: 2px solid #fff;
}
.version-item.current {
    border-left-color: #15a362;
}
.version-meta {
    font-size: 0.78rem;
    color: #6c757d;
}

/* ---- Mobile Upload Wizard ---- */
@media (max-width: 768px) {
    .upload-wizard-steps {
        display: flex;
        justify-content: center;
        gap: 0;
        margin-bottom: 16px;
    }
    .upload-wizard-step {
        flex: 1;
        text-align: center;
        padding: 8px 4px;
        font-size: 0.72rem;
        font-weight: 600;
        color: #adb5bd;
        border-bottom: 3px solid #dee2e6;
    }
    .upload-wizard-step.active {
        color: #15a362;
        border-bottom-color: #15a362;
    }
    .upload-wizard-step.completed {
        color: #198754;
        border-bottom-color: #198754;
    }
    .upload-panel {
        display: none !important;
    }
    .upload-panel.active-panel {
        display: block !important;
    }
}

/* ---- Toast position adjustment ---- */
.toast-top-right {
    top: 70px !important;
}

/* ---- Smooth transitions ---- */
.app-card, .card {
    transition: box-shadow 0.2s;
}
.app-card:hover, .card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.08) !important;
}
