* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #0078D4;
    --primary-hover: #106EBE;
    --bg-color: #FFFFFF;
    --bg-secondary: #F3F3F3;
    --surface-color: #FFFFFF;
    --surface-hover: #E8F4F8;
    --text-primary: #1F1F1F;
    --text-secondary: #605E5C;
    --border-color: #EDEBE9;
    --border-hover: #C7E0F4;
    --error-color: #D13438;
    --success-color: #107C10;
    --accent-color: #0078D4;
    --selected-bg: #E8F4F8;
    --selected-border: #0078D4;
    --toolbar-bg: #F3F3F3;
    --ribbon-bg: #F9F9F9;
}

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
    background: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.screen {
    display: none;
    flex: 1;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.screen.active {
    display: flex;
}

/* Tabs */
.tabs-container {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    height: 40px;
}

.tabs {
    display: flex;
    align-items: center;
    height: 100%;
    padding: 0 0.5rem;
    gap: 0.25rem;
}

.tab {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid transparent;
    border-bottom: none;
    border-radius: 4px 4px 0 0;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-secondary);
    transition: all 0.2s;
    position: relative;
    height: 100%;
    align-items: center;
}

.tab:hover {
    background: var(--surface-color);
    color: var(--text-primary);
}

.tab.active {
    background: var(--surface-color);
    color: var(--text-primary);
    border-color: var(--border-color);
    border-bottom-color: var(--surface-color);
    z-index: 1;
    margin-bottom: -1px;
}

.tab svg {
    opacity: 0.7;
}

.tab.active svg {
    opacity: 1;
}

.tab-close {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.125rem 0.25rem;
    border-radius: 3px;
    font-size: 18px;
    line-height: 1;
    margin-left: 0.5rem;
    transition: all 0.2s;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tab-close:hover {
    background: var(--border-color);
    color: var(--text-primary);
}

.tab-content {
    display: none;
    flex: 1;
    overflow: hidden;
    min-height: 0; /* Critical for scrolling in flex containers */
}

.tab-content.active {
    display: flex;
    flex-direction: column;
    min-height: 0; /* Critical for scrolling in flex containers */
}

/* Login Screen */
.login-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
    text-align: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.logo {
    width: 80px;
    height: 80px;
    background: white;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2rem;
    color: #667eea;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.login-container h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: white;
}

.subtitle {
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 3rem;
    font-size: 1.1rem;
}

/* Login Form Styles */
.login-form {
    width: 100%;
    max-width: 400px;
    margin-top: 2rem;
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.form-group {
    margin-bottom: 1.25rem;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 16px;
    transition: all 0.2s;
    box-sizing: border-box;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: white;
}

.form-group input::placeholder {
    color: var(--text-secondary);
}

.login-button {
    width: 100%;
    padding: 14px 20px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.2s;
    margin-top: 1.5rem;
}

.login-button:hover {
    background: var(--primary-hover);
}

.login-button:active {
    transform: scale(0.98);
}

.login-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.form-footer {
    text-align: center;
    margin-top: 1.5rem;
    color: var(--text-secondary);
    font-size: 14px;
}

.form-footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.form-footer a:hover {
    text-decoration: underline;
}

.spinner-small {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.error-message {
    margin-top: 1rem;
    color: var(--error-color);
    font-size: 0.9rem;
    display: none;
    text-align: left;
}

.error-message.show {
    display: block;
}

/* Windows Explorer Style */
.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 1rem;
    background: linear-gradient(to bottom, #F8F8F8, #F0F0F0);
    border-bottom: 1px solid var(--border-color);
    height: 48px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.toolbar-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
}

.toolbar-btn {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-primary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    width: 36px;
    height: 36px;
    position: relative;
}

.toolbar-btn:hover:not(:disabled) {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.1);
}

.toolbar-btn:active:not(:disabled) {
    background: rgba(0, 0, 0, 0.1);
    transform: scale(0.95);
}

.toolbar-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.upload-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--error-color);
    color: white;
    border-radius: 10px;
    padding: 2px 6px;
    font-size: 11px;
    font-weight: bold;
    min-width: 18px;
    text-align: center;
    line-height: 1.2;
}

.toolbar-separator {
    width: 1px;
    height: 24px;
    background: var(--border-color);
    margin: 0 0.5rem;
}

.address-bar {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem 0.875rem;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 3px;
    font-size: 13px;
    flex: 1;
    max-width: 600px;
    margin-left: 1rem;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
    transition: all 0.2s;
}

.address-bar:hover {
    border-color: var(--primary-color);
}

.address-bar:focus-within {
    border-color: var(--primary-color);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05), 0 0 0 2px rgba(0, 120, 212, 0.1);
}

.address-item {
    color: var(--text-primary);
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
    transition: background 0.2s;
}

.address-item:hover {
    background: var(--surface-hover);
}

.address-separator {
    color: var(--text-secondary);
    margin: 0 0.25rem;
}

.view-toggle {
    display: flex;
    gap: 0.25rem;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 0.25rem;
}

.view-btn {
    background: transparent;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 0.375rem;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.view-btn:hover {
    background: var(--surface-hover);
}

.view-btn.active {
    background: var(--selected-bg);
    color: var(--primary-color);
}

/* Ribbon */
.ribbon {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: var(--ribbon-bg);
    border-bottom: 1px solid var(--border-color);
    height: 56px;
}

.ribbon-section {
    display: flex;
    gap: 0.5rem;
    padding-right: 1rem;
    border-right: 1px solid var(--border-color);
}

.ribbon-section:last-child {
    border-right: none;
}

.ribbon-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: transparent;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.2s;
}

.ribbon-btn:hover {
    background: var(--surface-hover);
}

.ribbon-btn svg {
    opacity: 0.8;
}

/* Explorer Content */
.explorer-content {
    display: flex;
    flex-direction: row;
    flex: 1;
    overflow: hidden;
    min-height: 0; /* Important for flex children to allow scrolling */
    height: 100%;
}

/* Sidebar */
.sidebar {
    width: 220px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    padding: 1rem 0;
    overflow-y: auto;
}

.sidebar-header {
    padding: 0.5rem 1rem;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    color: var(--text-primary);
    cursor: pointer;
    transition: background 0.2s;
    font-size: 14px;
}

.sidebar-item:hover {
    background: var(--surface-hover);
}

.sidebar-item.active {
    background: var(--selected-bg);
    color: var(--primary-color);
    font-weight: 500;
}

.sidebar-item svg {
    opacity: 0.7;
}

/* File Panel */
.file-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: white;
    min-height: 0; /* Critical for scrolling in flex containers */
}

/* File List Header (Details View) */
.file-list-header {
    display: grid;
    grid-template-columns: 40px 2fr 1.5fr 1fr 1fr;
    padding: 0.5rem 1rem;
    background: var(--bg-secondary);
    border-bottom: 2px solid var(--border-color);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.header-cell {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    user-select: none;
}

.header-cell.sortable {
    cursor: pointer;
    transition: background 0.2s;
}

.header-cell.sortable:hover {
    background: var(--surface-hover);
}

.sort-icon {
    opacity: 0.5;
    transition: opacity 0.2s;
}

.header-cell.sortable:hover .sort-icon {
    opacity: 1;
}

.checkbox-cell {
    justify-content: center;
}

.name-cell {
    min-width: 0;
}

/* File List Container */
.file-list-container {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
    min-height: 0; /* Critical for scrolling in flex containers */
    height: 100%;
}

/* File List - Details View */
.file-list.details-view {
    display: flex;
    flex-direction: column;
}

.file-item {
    display: grid;
    grid-template-columns: 40px 2fr 1.5fr 1fr 1fr;
    align-items: center;
    padding: 0.5rem 1rem;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: all 0.15s;
    font-size: 14px;
}

.file-item:hover {
    background: var(--surface-hover);
}

.file-item.selected {
    background: var(--selected-bg);
    border-left: 3px solid var(--primary-color);
}

.file-item-cell {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.file-item-cell.checkbox-cell {
    justify-content: center;
}

.file-item-cell input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.file-icon-cell {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.file-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.file-icon svg {
    width: 20px;
    height: 20px;
}

.file-name {
    font-weight: 400;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-primary);
}

.file-item.selected .file-name {
    font-weight: 500;
}

.file-date {
    color: var(--text-secondary);
    font-size: 13px;
}

.file-type {
    color: var(--text-secondary);
    font-size: 13px;
    text-transform: capitalize;
}

.file-size {
    color: var(--text-secondary);
    font-size: 13px;
    text-align: right;
}

/* File List - Grid View */
.file-list.grid-view {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 1rem;
    padding: 1rem;
}

.file-item.grid-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: white;
    transition: all 0.2s;
    grid-template-columns: none;
}

.file-item.grid-item:hover {
    border-color: var(--border-hover);
    box-shadow: 0 2px 8px rgba(0, 120, 212, 0.1);
}

.file-item.grid-item .file-icon {
    width: 48px;
    height: 48px;
    margin-bottom: 0.5rem;
}

.file-item.grid-item .file-name {
    text-align: center;
    font-size: 12px;
    word-break: break-word;
    white-space: normal;
    line-height: 1.4;
}

/* Loading */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    color: var(--text-secondary);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    color: var(--text-secondary);
    text-align: center;
}

.empty-state svg {
    margin-bottom: 1.5rem;
    opacity: 0.3;
}

.empty-state p {
    font-size: 16px;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.empty-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
}

/* Status Bar */
.status-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.375rem 1rem;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    font-size: 12px;
    color: var(--text-secondary);
    height: 28px;
}

.status-item {
    padding: 0 0.5rem;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 1000;
    overflow: auto;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    position: relative;
    max-width: 500px;
    width: 90%;
    margin: 2rem auto;
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 24px;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

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

.modal-body {
    min-width: auto;
}

.modal-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

.btn-primary {
    padding: 0.625rem 1.25rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-secondary {
    padding: 0.625rem 1.25rem;
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
}

.btn-secondary:hover {
    background: var(--surface-hover);
}

/* Upload Area */
.upload-area {
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    margin-bottom: 1rem;
    background: var(--bg-secondary);
}

.upload-area:hover,
.upload-area.drag-over {
    border-color: var(--primary-color);
    background: var(--surface-hover);
}

.upload-area svg {
    margin-bottom: 1rem;
    opacity: 0.5;
}

.upload-hint {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

.upload-progress {
    max-height: 300px;
    overflow-y: auto;
}

.upload-item {
    padding: 0.75rem;
    background: var(--bg-secondary);
    border-radius: 6px;
    margin-bottom: 0.5rem;
}

.upload-item-name {
    font-weight: 500;
    margin-bottom: 0.5rem;
    font-size: 14px;
}

.upload-item-progress {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: var(--border-color);
    border-radius: 3px;
    overflow: hidden;
}

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

.progress-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.progress-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.progress-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.7rem;
    color: var(--text-secondary);
    opacity: 0.8;
}

.progress-text {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    min-width: 45px;
}

.progress-size {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-family: 'Monaco', 'Menlo', 'Courier New', monospace;
}

.progress-speed {
    font-size: 0.7rem;
    color: var(--text-secondary);
    font-family: 'Monaco', 'Menlo', 'Courier New', monospace;
}

.progress-remaining {
    font-size: 0.7rem;
    color: var(--text-secondary);
}

.upload-complete .progress-fill {
    background: var(--success-color);
}

.upload-error .progress-fill {
    background: var(--error-color);
}

/* Mass Upload Modal */
.mass-upload-modal .modal-content {
    max-width: 900px;
    width: 90vw;
    max-height: 90vh;
}

.mass-upload-content {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.mass-upload-info {
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: 6px;
    margin-bottom: 1rem;
}

.mass-upload-info p {
    margin: 0.25rem 0;
    font-size: 0.875rem;
}

.mass-upload-info .hint {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.mass-upload-progress {
    max-height: 500px;
    overflow-y: auto;
    padding: 0.5rem;
    background: var(--bg-primary);
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.mass-upload-progress .upload-item {
    margin-bottom: 0.75rem;
}

.mass-upload-progress .folder-progress {
    background: linear-gradient(135deg, rgba(33, 150, 243, 0.1) 0%, rgba(33, 150, 243, 0.05) 100%);
    border: 1px solid rgba(33, 150, 243, 0.3);
}

.mass-upload-progress .overall-progress {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.1) 0%, rgba(76, 175, 80, 0.05) 100%);
    border: 1px solid rgba(76, 175, 80, 0.3);
}

.upload-separator {
    margin: 1rem 0;
}

/* Context Menu */
.context-menu {
    display: none;
    position: fixed;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.05);
    padding: 4px;
    z-index: 10000;
    min-width: 200px;
    font-size: 14px;
}

.context-menu-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    border-radius: 3px;
    color: var(--text-primary);
    transition: background 0.15s;
    position: relative;
}

.context-menu-item:hover:not(.disabled) {
    background: var(--selected-bg);
}

.context-menu-item svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    opacity: 0.8;
}

.context-menu-item span:not(.context-menu-shortcut) {
    flex: 1;
}

.context-menu-shortcut {
    color: var(--text-secondary);
    font-size: 12px;
    margin-left: auto;
    opacity: 0.7;
    font-family: 'Monaco', 'Menlo', 'Courier New', monospace;
}

.context-menu-separator {
    height: 1px;
    background: var(--border-color);
    margin: 4px 0;
}

.context-menu-item:disabled,
.context-menu-item.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.context-menu-item:disabled:hover,
.context-menu-item.disabled:hover {
    background: transparent;
}

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--text-primary);
    color: white;
    padding: 12px 20px;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    font-size: 14px;
    max-width: 300px;
    word-wrap: break-word;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast-success {
    background: var(--success-color);
}

.toast-error {
    background: var(--error-color);
}

.toast-warning {
    background: #FF8C00;
}

.toast-info {
    background: var(--primary-color);
}

/* Drag Overlay */
.drag-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 120, 212, 0.1);
    backdrop-filter: blur(2px);
    z-index: 1500;
    border: 3px dashed var(--primary-color);
    animation: fadeIn 0.2s ease;
}

.drag-overlay.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.drag-overlay-content {
    text-align: center;
    color: var(--primary-color);
}

.drag-overlay-content svg {
    margin-bottom: 1rem;
    opacity: 0.8;
}

.drag-overlay-content p {
    font-size: 18px;
    font-weight: 600;
}

/* Photos Tab */
.photos-container {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    background: var(--bg-color);
}

.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.photo-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    transition: all 0.2s;
}

.photo-item:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.photo-item.loading {
    display: flex;
    align-items: center;
    justify-content: center;
}

.photo-item.loading::after {
    content: '';
    width: 30px;
    height: 30px;
    border: 2px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Photo Modal */
.photo-modal-content {
    max-width: 90vw;
    max-height: 90vh;
    padding: 0;
    background: rgba(0, 0, 0, 0.95);
}

.photo-modal-content .modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    z-index: 1001;
}

.photo-modal-content .modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.photo-modal-content img {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

.photo-modal-content .modal-info {
    padding: 1rem;
    color: white;
    background: rgba(0, 0, 0, 0.5);
}

/* Settings */
.settings-section {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.settings-section:last-child {
    border-bottom: none;
}

.settings-section h4 {
    margin-bottom: 1rem;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.settings-section label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.settings-section input[type="radio"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.setting-description {
    font-size: 13px;
    color: var(--text-secondary);
    margin-left: 2rem;
    margin-top: 0.25rem;
    margin-bottom: 1rem;
}

.instructions-box {
    background: var(--bg-secondary);
    padding: 1rem;
    border-radius: 6px;
    border-left: 3px solid var(--primary-color);
}

.instructions-box p {
    margin-bottom: 0.75rem;
    font-weight: 500;
}

.instructions-box ol {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.instructions-box li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.connection-status {
    margin-left: 1rem;
    font-size: 14px;
    font-weight: 500;
}

.connection-status.success {
    color: var(--success-color);
}

.connection-status.error {
    color: var(--error-color);
}

.connection-status.testing {
    color: var(--text-secondary);
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        width: 180px;
    }
    
    .file-list-header {
        font-size: 11px;
        padding: 0.5rem;
    }
    
    .file-item {
        padding: 0.5rem;
        font-size: 13px;
    }
    
    .toolbar {
        padding: 0.5rem;
    }
    
    .address-bar {
        max-width: 200px;
        font-size: 12px;
    }
    
    .photo-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 0.75rem;
    }
}
