/* =============================================================================
   File Drop Zone Styles

   Drop overlay, file chips, progress bars, quality toggle.
   Dark mode via .prompt-page.dark-mode prefix (consistent with prompt.css).
   ============================================================================= */

/* ===== LIGHT MODE (DEFAULT) ===== */

/* ---------------------------------------------------------------------------
   Drop Overlay
   --------------------------------------------------------------------------- */

.file-drop-overlay {
    position: absolute;
    inset: 0;
    z-index: 100;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.file-drop-overlay.active {
    display: flex;
    pointer-events: auto;
}

/* Green state -- default during drag (optimistic, valid files assumed) */
.file-drop-overlay.active .drop-zone-content {
    border-color: #4CAF50;
    background: rgba(76, 175, 80, 0.08);
}

.file-drop-overlay.active .drop-zone-content i {
    color: #4CAF50;
}

/* Red state -- invalid files detected on drop */
.file-drop-overlay.invalid .drop-zone-content {
    border-color: #f44336;
    background: rgba(244, 67, 54, 0.08);
    transition: border-color 0.15s ease, background 0.15s ease;
}

.file-drop-overlay.invalid .drop-zone-content i {
    color: #f44336;
}

.file-drop-overlay.invalid .drop-zone-title {
    color: #f44336;
}

/* Drop zone content box */
.drop-zone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 64px;
    border: 2px dashed #9e9e9e;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.06);
    text-align: center;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.drop-zone-content i {
    font-size: 48px;
    color: #9e9e9e;
    margin-bottom: 16px;
    transition: color 0.2s ease;
}

.drop-zone-title {
    font-size: 18px;
    font-weight: 600;
    color: #ffffff;
    margin: 0 0 6px;
    transition: color 0.15s ease;
}

.drop-zone-hint {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.65);
}

/* ---------------------------------------------------------------------------
   File Chip Container
   --------------------------------------------------------------------------- */

.file-chip-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 12px;
    background: #f5f5f5;
    border-top: 1px solid #e0e0e0;
    border-radius: 8px 8px 0 0;
    max-height: 160px;
    overflow-y: auto;
}

.file-chip-container:empty {
    display: none;
}

/* ---------------------------------------------------------------------------
   File Chip
   --------------------------------------------------------------------------- */

.file-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    max-width: 220px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.file-chip:hover {
    border-color: #bdbdbd;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* ---------------------------------------------------------------------------
   Chip Preview (Thumbnail / Icon)
   --------------------------------------------------------------------------- */

.file-chip-preview {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 4px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f9f9f9;
}

.file-chip-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.file-chip-icon {
    font-size: 18px;
    color: #757575;
}

/* File type icon colors */
.file-chip-icon.fa-file-pdf {
    color: #e53935;
}

.file-chip-icon.fa-file-excel {
    color: #43a047;
}

.file-chip-icon.fa-file-word {
    color: #1e88e5;
}

.file-chip-icon.fa-file-powerpoint {
    color: #fb8c00;
}

.file-chip-icon.fa-file-archive {
    color: #8e24aa;
}

.file-chip-icon.fa-file-code {
    color: #00897b;
}

/* ---------------------------------------------------------------------------
   Chip Info (Filename + Progress)
   --------------------------------------------------------------------------- */

.file-chip-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.file-chip-name {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: #333333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
}

/* ---------------------------------------------------------------------------
   Progress Bar
   --------------------------------------------------------------------------- */

.file-chip-progress {
    height: 3px;
    background: #e0e0e0;
    border-radius: 2px;
    margin-top: 4px;
    overflow: hidden;
}

.file-chip-progress .progress-bar {
    height: 100%;
    width: 0;
    background: #2196F3;
    border-radius: 2px;
    transition: width 0.3s ease;
}

.file-chip-progress .progress-bar.complete {
    background: #4CAF50;
}

/* ---------------------------------------------------------------------------
   Chip Actions (Quality Toggle + Remove)
   --------------------------------------------------------------------------- */

.file-chip-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

/* Quality toggle button */
.file-chip-quality {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 6px;
    border: 1px solid #d0d0d0;
    border-radius: 4px;
    background: #f0f0f0;
    color: #999999;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.3px;
    cursor: pointer;
    transition: all 0.15s ease;
    line-height: 1.4;
}

.file-chip-quality:hover {
    border-color: #b0b0b0;
    background: #e8e8e8;
}

/* High quality active state */
.file-chip-quality.quality-high {
    background: #e3f2fd;
    border-color: #1e88e5;
    color: #1e88e5;
}

.file-chip-quality.quality-high:hover {
    background: #bbdefb;
}

/* Remove button */
.file-chip-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    padding: 0;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: #999999;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.file-chip-remove:hover {
    background: #ffebee;
    color: #e53935;
}

/* ===== DARK MODE ===== */

/* ---------------------------------------------------------------------------
   Dark Mode - Drop Overlay
   --------------------------------------------------------------------------- */

.prompt-page.dark-mode .file-drop-overlay {
    background: rgba(0, 0, 0, 0.55);
}

.prompt-page.dark-mode .drop-zone-content {
    border-color: #616161;
    background: rgba(255, 255, 255, 0.04);
}

.prompt-page.dark-mode .drop-zone-content i {
    color: #757575;
}

.prompt-page.dark-mode .file-drop-overlay.active .drop-zone-content {
    border-color: #66bb6a;
    background: rgba(76, 175, 80, 0.12);
}

.prompt-page.dark-mode .file-drop-overlay.active .drop-zone-content i {
    color: #66bb6a;
}

.prompt-page.dark-mode .file-drop-overlay.invalid .drop-zone-content {
    border-color: #ef5350;
    background: rgba(244, 67, 54, 0.12);
}

.prompt-page.dark-mode .file-drop-overlay.invalid .drop-zone-content i {
    color: #ef5350;
}

.prompt-page.dark-mode .file-drop-overlay.invalid .drop-zone-title {
    color: #ef5350;
}

.prompt-page.dark-mode .drop-zone-title {
    color: #e0e0e0;
}

.prompt-page.dark-mode .drop-zone-hint {
    color: rgba(255, 255, 255, 0.45);
}

/* ---------------------------------------------------------------------------
   Dark Mode - File Chip Container
   --------------------------------------------------------------------------- */

.prompt-page.dark-mode .file-chip-container {
    background: #1e1e1e;
    border-top-color: #333333;
}

/* ---------------------------------------------------------------------------
   Dark Mode - File Chip
   --------------------------------------------------------------------------- */

.prompt-page.dark-mode .file-chip {
    background: #2a2a2a;
    border-color: #3a3a3a;
}

.prompt-page.dark-mode .file-chip:hover {
    border-color: #505050;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.prompt-page.dark-mode .file-chip-preview {
    background: #333333;
}

.prompt-page.dark-mode .file-chip-icon {
    color: #9e9e9e;
}

.prompt-page.dark-mode .file-chip-name {
    color: #e0e0e0;
}

/* ---------------------------------------------------------------------------
   Dark Mode - Progress Bar
   --------------------------------------------------------------------------- */

.prompt-page.dark-mode .file-chip-progress {
    background: #333333;
}

.prompt-page.dark-mode .file-chip-progress .progress-bar {
    background: #42a5f5;
}

.prompt-page.dark-mode .file-chip-progress .progress-bar.complete {
    background: #66bb6a;
}

/* ---------------------------------------------------------------------------
   Dark Mode - Actions
   --------------------------------------------------------------------------- */

.prompt-page.dark-mode .file-chip-quality {
    background: #333333;
    border-color: #4a4a4a;
    color: #808080;
}

.prompt-page.dark-mode .file-chip-quality:hover {
    background: #3a3a3a;
    border-color: #5a5a5a;
}

.prompt-page.dark-mode .file-chip-quality.quality-high {
    background: rgba(30, 136, 229, 0.15);
    border-color: #42a5f5;
    color: #42a5f5;
}

.prompt-page.dark-mode .file-chip-quality.quality-high:hover {
    background: rgba(30, 136, 229, 0.25);
}

.prompt-page.dark-mode .file-chip-remove {
    color: #808080;
}

.prompt-page.dark-mode .file-chip-remove:hover {
    background: rgba(229, 57, 53, 0.15);
    color: #ef5350;
}

/* ---------------------------------------------------------------------------
   Dark Mode - File Type Icon Colors (slightly adjusted for dark bg)
   --------------------------------------------------------------------------- */

.prompt-page.dark-mode .file-chip-icon.fa-file-pdf {
    color: #ef5350;
}

.prompt-page.dark-mode .file-chip-icon.fa-file-excel {
    color: #66bb6a;
}

.prompt-page.dark-mode .file-chip-icon.fa-file-word {
    color: #42a5f5;
}

.prompt-page.dark-mode .file-chip-icon.fa-file-powerpoint {
    color: #ffa726;
}

.prompt-page.dark-mode .file-chip-icon.fa-file-archive {
    color: #ab47bc;
}

.prompt-page.dark-mode .file-chip-icon.fa-file-code {
    color: #26a69a;
}
