/* =============================================
   Dashboard - Spotlight-style Search Interface
   ============================================= */

.dashboard-page {
    overflow: hidden;
}

/* Dashboard Header */
.dashboard-header {
    background-color: var(--surface-glass);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left, .header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-btn {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-secondary);
    padding: 8px 12px;
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 500;
    font-family: var(--font-sans);
}

.header-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--border-color);
}

.user-email {
    font-size: 13px;
    color: var(--text-tertiary);
    font-family: var(--font-mono);
    padding: 0 8px;
}

/* Dashboard Container */
.dashboard-container {
    position: relative;
    height: calc(100vh - 60px);
    overflow: hidden;
}

/* =============================================
   Center Search Interface (Spotlight-style)
   ============================================= */

.search-center {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 15vh;
    z-index: 10;
}

.search-box {
    width: 100%;
    max-width: 700px;
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 10px 10px -5px rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.search-input-wrapper {
    position: relative;
    padding: 20px 24px 16px;
    border-bottom: 1px solid var(--border-color);
}

.search-icon {
    position: absolute;
    left: 24px;
    top: 28px;
    color: var(--text-tertiary);
    pointer-events: none;
}

.main-search-input {
    width: 100%;
    padding: 8px 16px 8px 44px;
    border: none;
    background: transparent;
    font-size: 20px;
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-weight: 400;
    outline: none;
}

.main-search-input::placeholder {
    color: var(--text-tertiary);
}

.search-hint {
    margin-top: 12px;
    font-size: 12px;
    color: var(--text-tertiary);
    display: flex;
    align-items: center;
    gap: 16px;
    padding-left: 44px;
}

.search-hint kbd {
    background: var(--surface-alt);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 2px 6px;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-secondary);
}

/* Search Mode Toggle */
.search-mode-toggle {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    background: var(--background);
    border-bottom: 1px solid var(--border-color);
}

.mode-btn {
    flex: 1;
    padding: 8px 16px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-family: var(--font-sans);
}

.mode-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.mode-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

/* Instant Results */
.instant-results {
    max-height: 60vh;
    overflow-y: auto;
    background: var(--background);
}

.results-header {
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    background: var(--surface);
}

.results-count {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

.search-mode-indicator {
    font-size: 11px;
    color: var(--primary-color);
    padding: 4px 8px;
    background: rgba(168, 85, 247, 0.1);
    border-radius: 4px;
    border: 1px solid rgba(168, 85, 247, 0.2);
    font-family: var(--font-mono);
}

.results-list {
    padding: 8px 0;
}

/* Result Item */
.result-item {
    padding: 12px 20px;
    cursor: pointer;
    transition: var(--transition);
    border-left: 3px solid transparent;
}

.result-item:hover,
.result-item.selected {
    background: var(--surface);
    border-left-color: var(--primary-color);
}

.result-item.selected {
    background: rgba(168, 85, 247, 0.1);
}

.result-header-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.result-type-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-alt);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 18px;
    flex-shrink: 0;
}

.result-file-info {
    flex: 1;
    min-width: 0;
}

.result-file-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.result-location-badge {
    margin-left: auto;
    font-size: 11px;
    color: var(--primary-color);
    background: rgba(168, 85, 247, 0.1);
    padding: 3px 8px;
    border-radius: 4px;
    border: 1px solid rgba(168, 85, 247, 0.2);
    font-family: var(--font-mono);
    flex-shrink: 0;
}

.result-preview-text {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-left: 44px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.result-preview-text mark {
    background: rgba(168, 85, 247, 0.25);
    color: #e9d5ff;
    padding: 2px 4px;
    border-radius: 2px;
    font-weight: 500;
}

/* Empty State */
.results-empty {
    padding: 60px 20px;
    text-align: center;
    color: var(--text-secondary);
}

.results-empty-icon {
    margin-bottom: 16px;
    opacity: 0.5;
    color: var(--text-tertiary);
}

/* =============================================
   View Panels (Upload & Files)
   ============================================= */

.view-panel {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--background);
    z-index: 20;
    overflow-y: auto;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 32px;
    border-bottom: 1px solid var(--border-color);
    background: var(--surface);
}

.panel-header h2 {
    font-size: 24px;
    font-weight: 700;
}

.close-panel {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius);
    transition: var(--transition);
}

.close-panel:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.panel-content {
    padding: 32px;
    max-width: 1200px;
    margin: 0 auto;
}

/* Upload Dropzone */
.upload-dropzone {
    background: rgba(255, 255, 255, 0.02);
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    padding: 80px 40px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
}

.upload-dropzone:hover,
.upload-dropzone.dragover {
    border-color: var(--primary-color);
    background: rgba(168, 85, 247, 0.05);
}

.upload-icon {
    margin: 0 auto 24px;
    color: var(--primary-color);
}

.upload-dropzone h3 {
    font-size: 20px;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.upload-dropzone p {
    color: var(--text-secondary);
    font-size: 14px;
}

/* Upload Progress */
.upload-progress {
    margin-top: 24px;
    background: var(--surface);
    padding: 20px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
}

.progress-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    font-size: 14px;
}

.progress-bar {
    height: 8px;
    background: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--primary-color);
    width: 0%;
    transition: width 0.3s ease;
}

/* Files Grid */
.files-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.file-card {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    transition: var(--transition);
    cursor: pointer;
}

.file-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 1px var(--primary-color);
    transform: translateY(-2px);
}

.file-card-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-alt);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 24px;
    margin-bottom: 16px;
}

.file-card-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-card-meta {
    font-size: 12px;
    color: var(--text-tertiary);
    font-family: var(--font-mono);
    display: flex;
    justify-content: space-between;
}

/* =============================================
   Quick Preview Sidebar
   ============================================= */

.preview-sidebar {
    position: fixed;
    right: 0;
    top: 60px;
    bottom: 0;
    width: 450px;
    background: var(--surface);
    border-left: 1px solid var(--border-color);
    box-shadow: -10px 0 20px rgba(0, 0, 0, 0.3);
    z-index: 90;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.preview-sidebar.open {
    transform: translateX(0);
}

.preview-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--surface-alt);
}

.preview-header h3 {
    font-size: 16px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

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

.preview-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 6px;
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
}

.preview-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border-color: var(--text-primary);
}

.preview-content {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    background: var(--background);
}

/* Preview Content Types */
.preview-text-content {
    font-size: 14px;
    line-height: 1.8;
    color: var(--text-secondary);
    white-space: pre-wrap;
    font-family: var(--font-mono);
}

.preview-text-content mark {
    background: rgba(168, 85, 247, 0.25);
    color: #e9d5ff;
    padding: 2px 4px;
    border-radius: 2px;
}

.preview-image-content {
    display: flex;
    justify-content: center;
    align-items: center;
}

.preview-image-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
}

.preview-video-content,
.preview-audio-content {
    width: 100%;
}

.preview-video-content video,
.preview-audio-content audio {
    width: 100%;
    border-radius: var(--radius);
}

/* =============================================
   Full Preview Modal
   ============================================= */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--surface);
    width: 90%;
    max-width: 1000px;
    height: 90vh;
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--border-color);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--surface-alt);
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    transition: var(--transition);
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 32px;
    background: var(--background);
}

/* =============================================
   Loading States
   ============================================= */

.loading {
    padding: 40px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 14px;
}

.loading::after {
    content: '...';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

/* =============================================
   Responsive
   ============================================= */

@media (max-width: 768px) {
    .search-center {
        padding: 20px;
        padding-top: 10vh;
    }
    
    .search-box {
        max-width: 100%;
    }
    
    .main-search-input {
        font-size: 16px;
    }
    
    .preview-sidebar {
        width: 100%;
    }
    
    .files-grid {
        grid-template-columns: 1fr;
    }
}
