/* ===================================
   Settings & Modals
   =================================== */

/* Settings Area */
.settings-area {
    margin-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* Settings Button */
.settings-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 8px 12px;
    font-size: 1.25rem;
    transition: all var(--transition-fast);
    border-radius: var(--radius-sm);
}

.settings-btn:hover {
    color: var(--accent);
    background: rgba(139, 92, 246, 0.1);
}

/* Retro theme settings button */
[data-theme="retro"] .settings-btn:hover {
    box-shadow: 2px 2px 0 var(--accent);
}

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Modal */
.modal {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 28px;
    width: 90%;
    max-width: 450px;
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transform: scale(0.9);
    transition: transform var(--transition-base);
}

.modal-overlay.active .modal {
    transform: scale(1);
}

/* Retro theme modal */
[data-theme="retro"] .modal {
    border-radius: 0;
    border: 4px solid var(--text-main);
}

/* Modal Header */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.modal-header h2 {
    font-size: 1.5rem;
    color: var(--text-main);
    margin-bottom: 0;
    text-transform: none;
    letter-spacing: -0.01em;
}

/* Modal Close Button */
.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.5rem;
    padding: 4px 8px;
    transition: all var(--transition-fast);
    border-radius: var(--radius-sm);
}

.modal-close:hover {
    color: var(--danger);
    background: rgba(239, 68, 68, 0.1);
}

/* Settings Group */
.settings-group {
    margin-bottom: 24px;
}

.settings-group:last-child {
    margin-bottom: 0;
}

.settings-group label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 12px;
    font-weight: 700;
}

/* Theme Options */
.theme-options {
    display: flex;
    gap: 12px;
}

.theme-option {
    flex: 1;
    padding: 16px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    text-align: center;
}

.theme-option:hover {
    border-color: var(--accent);
    background: rgba(139, 92, 246, 0.1);
}

.theme-option.active {
    border-color: var(--accent);
    background: rgba(139, 92, 246, 0.15);
}

/* Retro theme options */
[data-theme="retro"] .theme-option {
    border-radius: 0;
    border-width: 2px;
}

[data-theme="retro"] .theme-option:hover,
[data-theme="retro"] .theme-option.active {
    box-shadow: 2px 2px 0 var(--accent);
}

/* Leather theme options */
[data-theme="leather"] .theme-option:hover,
[data-theme="leather"] .theme-option.active,
[data-theme="leather"] .accent-color-option.active {
    box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.3);
}

.theme-option-icon {
    font-size: 1.5rem;
    margin-bottom: 4px;
}

.theme-option-name {
    font-size: 0.875rem;
    color: var(--text-main);
    font-weight: 500;
}

/* Accent Color Options */
.accent-color-options {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.accent-color-option {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    border: 3px solid transparent;
    transition: all var(--transition-fast);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.accent-color-option:hover {
    transform: scale(1.1);
}

.accent-color-option.active {
    border-color: var(--text-main);
    transform: scale(1.15);
}

/* Retro accent color options */
[data-theme="retro"] .accent-color-option {
    border-radius: 0;
}

[data-theme="retro"] .accent-color-option.active {
    box-shadow: 2px 2px 0 var(--text-main);
}

/* Settings Actions */
.settings-actions {
    display: flex;
    gap: 10px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* Reset Button */
.btn-reset {
    flex: 1;
    background: transparent;
    border: 1px solid var(--danger);
    color: var(--danger);
    padding: 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 600;
    transition: all var(--transition-fast);
}

.btn-reset:hover {
    background: rgba(239, 68, 68, 0.1);
}

/* Save Button */
.btn-save {
    flex: 1;
    background: linear-gradient(135deg, var(--accent), var(--accent-light));
    color: white;
    border: none;
    padding: 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 600;
    transition: all var(--transition-fast);
}

.btn-save:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--accent-glow);
}

/* Retro save button */
[data-theme="retro"] .btn-save,
[data-theme="retro"] .btn-reset,
[data-theme="retro"] .btn-export,
[data-theme="retro"] .import-label {
    border-radius: 0;
}

[data-theme="retro"] .btn-save:hover {
    transform: translate(-1px, -1px);
    box-shadow: 2px 2px 0 var(--text-main);
}

/* Export Button */
.btn-export {
    background: transparent;
    border: 1px solid var(--text-muted);
    color: var(--text-muted);
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.8125rem;
    font-weight: 500;
    transition: all var(--transition-fast);
}

.btn-export:hover {
    border-color: var(--text-main);
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.03);
}

/* Import Label */
.import-label {
    background: transparent;
    border: 1px solid var(--text-muted);
    color: var(--text-muted);
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.8125rem;
    font-weight: 500;
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    user-select: none;
}

.import-label:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(139, 92, 246, 0.1);
}

/* Import Hidden Input */
.import-hidden-input {
    display: none;
}