/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    border: none;
    text-decoration: none;
}

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

.btn-primary {
    background: var(--accent);
    color: white;
}

.btn-primary i {
    color: white;
}

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

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-primary);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--bg-hover);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}

.btn-ghost:hover:not(:disabled) {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

.btn-lg {
    padding: 12px 24px;
    font-size: 15px;
}

/* Inputs */
.input {
    width: 100%;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    padding: 8px 12px;
    color: var(--text-primary);
    font-size: 14px;
    transition: border-color var(--transition-fast);
}

.input:focus {
    outline: none;
    border-color: var(--accent);
}

.input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

select.input {
    cursor: pointer;
}

/* Theme Toggle */
.theme-toggle {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.theme-toggle:hover {
    background: var(--bg-hover);
    color: var(--accent);
}

.theme-toggle i {
    font-size: 20px;
}

/* Dropdown Menu */
.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    min-width: 200px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    padding: 4px;
    box-shadow: var(--shadow-lg);
    z-index: 100;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    color: var(--text-primary);
    text-decoration: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background var(--transition-fast);
}

.dropdown-item:hover {
    background: var(--bg-hover);
}

.dropdown-item i {
    font-size: 18px;
    color: var(--text-muted);
}

.dropdown-divider {
    height: 1px;
    background: var(--border-primary);
    margin: 4px 0;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
}

.modal-large {
    max-width: 900px;
}

.modal-fullscreen {
    width: 95vw;
    height: 95vh;
    max-width: none;
    max-height: none;
}

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

.modal-header h3 {
    margin: 0;
}

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

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

.modal-body {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 20px;
    border-top: 1px solid var(--border-primary);
}

/* Form */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 6px;
}

.form-group-inline {
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-group-inline label {
    margin-bottom: 0;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 400px;
}

.toast {
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast.success { border-left: 3px solid var(--status-success); }
.toast.error { border-left: 3px solid var(--status-error); }
.toast.warning { border-left: 3px solid var(--status-warning); }
.toast.info { border-left: 3px solid var(--status-info); }

.toast i {
    font-size: 20px;
    flex-shrink: 0;
}

.toast.success i { color: var(--status-success); }
.toast.error i { color: var(--status-error); }
.toast.warning i { color: var(--status-warning); }
.toast.info i { color: var(--status-info); }

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9998;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--bg-tertiary);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Upload Progress */
.upload-progress-list {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 350px;
    max-height: 400px;
    overflow-y: auto;
    z-index: 9997;
}

.upload-progress-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    padding: 12px;
    margin-bottom: 8px;
    box-shadow: var(--shadow-md);
}

.upload-progress-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.upload-progress-header i {
    font-size: 18px;
    color: var(--text-muted);
}

.upload-progress-name {
    flex: 1;
    font-size: 13px;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.upload-progress-bar {
    width: 100%;
    height: 4px;
    background: var(--bg-tertiary);
    border-radius: 2px;
    overflow: hidden;
}

.upload-progress-bar-fill {
    height: 100%;
    background: var(--accent);
    transition: width 0.2s ease;
}

.upload-progress-status {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Context Menu */
.context-menu {
    position: fixed;
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    padding: 4px;
    box-shadow: var(--shadow-lg);
    z-index: 9999;
    min-width: 200px;
}

.context-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    color: var(--text-primary);
    cursor: pointer;
    border-radius: var(--radius-md);
    transition: background var(--transition-fast);
}

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

.context-menu-item.danger:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--status-error);
}

.context-menu-item i {
    font-size: 18px;
    color: var(--text-muted);
}

.context-menu-item.danger i {
    color: var(--status-error);
}

/* Drag and Drop Zone */
.drop-zone {
    border: 2px dashed var(--border-secondary);
    border-radius: var(--radius-lg);
    padding: 60px 20px;
    text-align: center;
    transition: all var(--transition-fast);
}

.drop-zone.drag-over {
    border-color: var(--accent);
    background: var(--accent-light);
}

.drop-zone i {
    font-size: 48px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.drop-zone h3 {
    color: var(--text-primary);
    margin-bottom: 8px;
}

.drop-zone p {
    color: var(--text-muted);
    margin-bottom: 16px;
}
