/**
 * File Browser Styles
 * 
 * Styles for the rich file browser modal interface
 */

/* Modal Overlay */
.file-browser-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    outline: none;
}

.file-browser-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
}

.file-browser-content {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    width: 90%;
    max-width: 1000px;
    height: 80%;
    max-height: 700px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Header */
.file-browser-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #e1e5e9;
    background: #f8f9fa;
}

.file-browser-header h3 {
    margin: 0;
    color: #495057;
    font-size: 18px;
    font-weight: 600;
}

.file-browser-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #6c757d;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.file-browser-close:hover {
    background: #e9ecef;
    color: #495057;
}

/* Toolbar */
.file-browser-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    border-bottom: 1px solid #e1e5e9;
    background: #f8f9fa;
}

.file-browser-path {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.path-label {
    font-weight: 600;
    color: #495057;
}

.path-value {
    color: #6c757d;
    font-family: monospace;
    background: #e9ecef;
    padding: 4px 8px;
    border-radius: 4px;
    max-width: 400px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

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

.file-browser-actions button {
    background: #007bff;
    border: none;
    color: white;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
}

.file-browser-actions button:hover {
    background: #0056b3;
}

/* Main Content */
.file-browser-main {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Sidebar */
.file-browser-sidebar {
    width: 200px;
    border-right: 1px solid #e1e5e9;
    background: #f8f9fa;
    padding: 16px;
    overflow-y: auto;
}

.file-browser-sidebar h4 {
    margin: 0 0 12px 0;
    color: #495057;
    font-size: 14px;
    font-weight: 600;
}

.quick-access-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
    margin-bottom: 4px;
}

.quick-access-item:hover {
    background: #e9ecef;
}

.quick-access-item .icon {
    font-size: 16px;
}

.quick-access-item .name {
    font-size: 14px;
    color: #495057;
}

/* File List */
.file-browser-list {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.file-list-header {
    display: flex;
    padding: 12px 16px;
    border-bottom: 1px solid #e1e5e9;
    background: #f8f9fa;
    font-weight: 600;
    color: #495057;
    font-size: 14px;
}

.file-list-content {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
}

.col-name {
    flex: 2;
    display: flex;
    align-items: center;
    gap: 8px;
}

.col-type {
    flex: 1;
    text-align: center;
}

.col-size {
    flex: 1;
    text-align: right;
}

.col-modified {
    flex: 2;
    text-align: right;
}

/* File Items */
.file-item {
    display: flex;
    padding: 8px 16px;
    cursor: pointer;
    transition: background-color 0.2s;
    border-bottom: 1px solid #f1f3f4;
}

.file-item:hover {
    background: #f8f9fa;
}

.file-item.selected {
    background: #e3f2fd;
    border-color: #bbdefb;
}

.file-item.directory {
    font-weight: 500;
}

.file-item .icon {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

.file-item .name {
    color: #495057;
    font-size: 14px;
}

.file-item.directory .name {
    color: #1976d2;
}

/* States */
.loading, .error, .empty {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 200px;
    color: #6c757d;
    font-style: italic;
}

.error {
    color: #dc3545;
}

/* Footer */
.file-browser-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-top: 1px solid #e1e5e9;
    background: #f8f9fa;
}

.selected-file {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.selected-label {
    font-weight: 600;
    color: #495057;
}

.selected-path {
    color: #6c757d;
    font-family: monospace;
    background: #e9ecef;
    padding: 4px 8px;
    border-radius: 4px;
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-browser-buttons {
    display: flex;
    gap: 12px;
}

.file-browser-buttons button {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.2s;
}

.btn-select {
    background: #28a745;
    color: white;
}

.btn-select:hover:not(:disabled) {
    background: #218838;
}

.btn-select:disabled {
    background: #6c757d;
    cursor: not-allowed;
}

.btn-cancel {
    background: #6c757d;
    color: white;
}

.btn-cancel:hover {
    background: #5a6268;
}

/* Responsive Design */
@media (max-width: 768px) {
    .file-browser-content {
        width: 95%;
        height: 90%;
    }
    
    .file-browser-main {
        flex-direction: column;
    }
    
    .file-browser-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #e1e5e9;
        padding: 12px 16px;
    }
    
    .file-browser-toolbar {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }
    
    .file-browser-footer {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }
    
    .path-value,
    .selected-path {
        max-width: 100%;
    }
    
    .col-size,
    .col-modified {
        display: none;
    }
    
    .file-item .col-size,
    .file-item .col-modified {
        display: none;
    }
}