/* Sora.ion Universal Settings Styles */
:root {
    --ss-bg: #1a1a1a;
    --ss-surface: #2a2a2a;
    --ss-accent: #667eea;
    --ss-text: #ffffff;
    --ss-text-dim: #a0a0a0;
    --ss-border: rgba(255, 255, 255, 0.1);
}

/* Light mode fallback if data-theme is empty or light */
[data-theme=""] :root, 
body:not([data-theme="midnight"]) :root {
    --ss-bg: #ffffff;
    --ss-surface: #f5f7fa;
    --ss-accent: #5a8fc4;
    --ss-text: #1a1a2e;
    --ss-text-dim: #6b7280;
    --ss-border: #e5e7eb;
}

.ss-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.ss-modal-overlay.active { display: flex; }

.ss-modal {
    background: var(--ss-bg);
    color: var(--ss-text);
    width: 100%;
    max-width: 480px;
    max-height: 85vh;
    border-radius: 28px;
    border: 1px solid var(--ss-border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 30px 60px rgba(0,0,0,0.3);
    animation: ss-slide-up 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    transform: translate3d(0, 0, 0); /* Force GPU */
}

@media (max-width: 768px) {
    .ss-modal {
        max-height: 92vh;
        border-radius: 32px 32px 0 0;
        position: absolute;
        bottom: 0;
        border-bottom: none;
    }
    .ss-modal-overlay {
        align-items: flex-end;
        padding: 0;
    }
}

@keyframes ss-slide-up {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

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

.ss-header h2 { font-size: 20px; font-weight: 600; margin: 0; }
.ss-close { cursor: pointer; font-size: 24px; opacity: 0.6; transition: 0.2s; }
.ss-close:hover { opacity: 1; transform: rotate(90deg); }

.ss-content {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.ss-section { margin-bottom: 24px; }
.ss-section-title {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--ss-accent);
    margin-bottom: 12px;
    font-weight: 700;
}

.ss-item {
    background: var(--ss-surface);
    padding: 16px;
    border-radius: 16px;
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ss-item-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ss-label { font-size: 15px; font-weight: 500; }
.ss-desc { font-size: 12px; color: var(--ss-text-dim); }

.ss-input {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--ss-border);
    color: #fff;
    padding: 8px 12px;
    border-radius: 8px;
    outline: none;
    width: 120px;
    text-align: right;
}

.ss-select {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--ss-border);
    color: #fff;
    padding: 6px 10px;
    border-radius: 8px;
    outline: none;
    cursor: pointer;
}

.ss-btn {
    background: var(--ss-accent);
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
    width: 100%;
    margin-top: 8px;
}

.ss-btn:hover { transform: scale(1.02); filter: brightness(1.1); }
.ss-btn.secondary { background: var(--ss-surface); border: 1px solid var(--ss-border); }
.ss-btn.danger { background: rgba(255, 59, 48, 0.2); color: #ff3b30; border: 1px solid rgba(255, 59, 48, 0.3); }

.ss-trigger {
    position: fixed;
    bottom: 24px;
    left: 24px;
    width: 50px;
    height: 50px;
    background: var(--ss-accent);
    color: white;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: none;
    z-index: 9999;
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
    transition: 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    font-size: 20px;
}

.ss-trigger:hover { transform: scale(1.1) rotate(15deg); }

@media (max-width: 768px) {
    .ss-trigger {
        bottom: 16px;
        right: 16px; /* Switch to right for thumb reachability on mobile */
        left: auto;
        width: 56px;
        height: 56px;
        border-radius: 20px;
    }
    .ss-content {
        padding: 20px 16px 40px;
    }
    .ss-theme-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 10px;
    }
}
