/* --- Buttons --- */
.btn {
    border: 1px solid var(--muted2);
    color: var(--fg);
    background: transparent;
    padding: 0.55rem 0.9rem;
    border-radius: 9px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
    font-family: inherit;
}

.btn:hover {
    background: rgba(255,255,255,0.1);
}

.btn.primary {
    background: var(--accent);
    color: #000;
    border-color: transparent;
}

.btn.primary:hover {
    background: rgba(0, 255, 198, 0.8);
}

.btn.icon-btn {
    width: 28px;
    height: 28px;
    padding: 0;
    display: grid;
    place-items: center;
}

/* --- Modal Backdrop --- */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

/* --- Modal Window --- */
.modal {
    width: min(520px, 92vw);
    background: #0c0c0c;
    border: 1px solid var(--tileBorder);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
}

.modal header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--tileBorder);
    font-weight: 700;
    font-size: 1.1rem;
    background: rgba(255,255,255,0.02);
}

.modal .body {
    padding: 20px;
    max-height: 60vh;
    overflow-y: auto;
}

.modal footer {
    padding: 16px 20px;
    border-top: 1px solid var(--tileBorder);
    text-align: right;
    background: rgba(255,255,255,0.02);
}

/* --- Module Selection Grid (Add Modal) --- */
.mods-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.mod-card {
    border: 1px solid var(--tileBorder);
    background: #0f0f0f;
    border-radius: 10px;
    padding: 16px;
    cursor: pointer;
    text-align: center;
    transition: all 0.15s ease;
}

.mod-card:hover {
    border-color: rgba(255,255,255,0.3);
    background: rgba(255,255,255,0.08);
    transform: translateY(-2px);
}

.mod-icon {
    font-size: 2rem;
    margin-bottom: 8px;
}

.mod-name {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 4px;
}

.mod-desc {
    font-size: 0.75rem;
    color: var(--muted);
}

/* Locked State */
.mod-card.locked {
    opacity: 0.6;
    cursor: not-allowed;
    position: relative;
}

.mod-card.locked::after {
    content: '🔒';
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 14px;
}

/* --- Settings Forms (FIXED) --- */
/* We target the ID directly now to ensure styles apply */
#settingsForm {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

#settingsForm label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--muted);
}

#settingsForm input[type="text"],
#settingsForm select {
    width: 100%;
    padding: 0.75rem;
    background: #000;
    border: 1px solid var(--tileBorder);
    border-radius: 8px;
    color: #fff;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s;
}

#settingsForm input[type="text"]:focus,
#settingsForm select:focus {
    border-color: var(--accent);
}

/* Fix dropdown options visibility */
#settingsForm option {
    background: #000;
    color: #fff;
    padding: 10px;
}

/* Radio Button Groups (Row Layout) */
.radio-group {
    display: flex;
    gap: 20px;
    align-items: center;
}

.radio-group label {
    margin-bottom: 0 !important; /* Override global label margin */
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: var(--fg) !important;
}

.radio-group input[type="radio"] {
    accent-color: var(--accent);
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* --- Toast Notification --- */
.save-status {
    position: fixed;
    top: 90px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 600;
    z-index: 3000;
    opacity: 0;
    transform: translateX(20px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.save-status.show {
    opacity: 1;
    transform: translateX(0);
}

.save-status.success {
    background: rgba(0, 255, 198, 0.1);
    border: 1px solid var(--accent);
    color: var(--accent);
}

.save-status.error {
    background: rgba(255, 99, 99, 0.1);
    border: 1px solid var(--danger);
    color: var(--danger);
}

.save-status.loading {
    background: #1a1a1a;
    border: 1px solid #333;
    color: #fff;
}