/* generator.css — AI Sound Effect Generator (ElevenLabs) */

/* Main Container */
.sf-soundgen-block {
    margin: 0 auto;
    font-family: system-ui, sans-serif;
    padding: 28px;
    border-radius: 12px;
    box-shadow: 0 0 20px 0px rgba(0, 0, 0, 0.5);
    border: solid 1px #31343a;
    background: #25282c;
}

/* Quota inline (next to generate button) */
.sf-quota-inline {
    color: #8f9ca7;
    font-size: 0.85rem;
    padding-left: 4px;
}

.sf-quota-inline i {
    color: #f0c040;
    margin-right: 3px;
}

.sf-quota-inline #sf-remaining,
.sf-quota-inline #sf-rt-remaining {
    font-weight: 700;
    color: #e0e0e0;
}

.sf-get-credits-link {
    color: #f0c040;
    font-weight: 600;
    text-decoration: none;
}
.sf-get-credits-link:hover {
    text-decoration: underline;
}

/* Prompt label row */
.sf-prompt-label-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 6px;
}

.sf-prompt-label-row label {
    font-weight: 600;
    font-size: 0.95rem;
}

.sf-random-prompt {
    font-size: 0.82rem;
    color: #6b9fff;
    text-decoration: none;
    transition: color 0.2s;
}

.sf-random-prompt:hover {
    color: #9bbfff;
}

.sf-random-prompt i {
    margin-right: 3px;
}

/* Rows & Labels */
.sf-soundgen-row {
    margin-bottom: 16px;
}

.sf-soundgen-desc {
    display: block;
    font-size: 0.85rem;
    color: #666;
    margin-top: 2px;
}

/* Textarea */
.sf-soundgen-block textarea#sf-prompt {
    width: 100%;
    background: #1e2126;
    border: 1px solid #3a3f46;
    border-radius: 8px;
    color: #e0e0e0;
    padding: 12px 14px;
    font-size: 0.95rem;
    font-family: system-ui, sans-serif;
    resize: vertical;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.sf-soundgen-block textarea#sf-prompt:focus {
    outline: none;
    border-color: #6b9fff;
    box-shadow: 0 0 0 2px rgba(107, 159, 255, 0.15);
}

.sf-soundgen-block textarea#sf-prompt::placeholder {
    color: #555b63;
}

/* Duration controls */
.sf-duration-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sf-duration-controls input[type="range"] {
    flex: 1;
}

.sf-duration-val {
    min-width: 3em;
    text-align: right;
    font-weight: 600;
}

/* Prompt influence controls */
.sf-influence-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sf-influence-controls input[type="range"] {
    flex: 1;
}

.sf-influence-val {
    min-width: 3em;
    text-align: right;
    font-weight: 600;
}

/* Advanced options container */
.sf-soundgen-advanced {
    background: #1e2126;
    border: 1px solid #3a3f46;
    border-radius: 10px;
    padding: 31px 35px 31px;
    margin-bottom: 16px;
}

.sf-soundgen-advanced .sf-soundgen-row:last-child {
    margin-bottom: 0;
}

/* Disabled slider state (non-logged-in users) */
.sf-duration-controls input:disabled,
.sf-influence-controls input:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.sf-soundgen-advanced:has(input:disabled) label,
.sf-soundgen-advanced:has(input:disabled) .sf-duration-val,
.sf-soundgen-advanced:has(input:disabled) .sf-influence-val,
.sf-soundgen-advanced:has(input:disabled) .sf-soundgen-desc {
    opacity: 0.4;
}

/* Login hint */
.sf-soundgen-login-hint {
    font-size: 0.9rem;
    font-weight: 500;
    color: #e0e0e0;
    background: linear-gradient(135deg, #2a3a4a 0%, #1e3040 100%);
    border: 1px solid #3a5a7a;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 20px;
    text-align: center;
}

.sf-soundgen-login-hint i {
    color: #f0c040;
    margin-right: 4px;
}

.sf-soundgen-login-hint a {
    color: #6b9fff;
    text-decoration: none;
}

.sf-soundgen-login-hint a:hover {
    color: #9bbfff;
}

/* Generate controls */
.sf-soundgen-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 4px;
}

/* Generate button — full width on mobile */
.sf-soundgen-block #sf-generate-btn {
    padding: 14px 40px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 10px;
}

/* Output area */
.sf-soundgen-output {
    margin-top: 20px;
}

.sf-soundgen-result {
    background: #2d3238;
    border-radius: 8px;
    padding: 16px;
    border: 1px solid #3a3f46;
}

.sf-soundgen-success {
    color: #1de9b6;
    font-size: 0.95rem;
    margin-bottom: 10px;
}

.sf-soundgen-success i {
    margin-right: 4px;
}

.sf-soundgen-links {
    display: flex;
    gap: 16px;
    margin-top: 10px;
}

.sf-soundgen-links a {
    font-size: 0.9rem;
    color: #6b9fff;
    text-decoration: none;
    transition: color 0.2s;
}

.sf-soundgen-links a:hover {
    color: #9bbfff;
}

/* Note below links */
.sf-soundgen-note {
    margin-top: 12px;
    font-size: 0.82rem;
    color: #7a8590;
    line-height: 1.5;
}

/* Daily limit message */
.sf-soundgen-limit-msg {
    text-align: center;
    padding: 16px;
    background: #3a2a1a;
    border: 1px solid #5a4020;
    border-radius: 6px;
    color: #f0c040;
    font-size: 0.95rem;
}

.sf-soundgen-limit-msg i {
    margin-right: 6px;
}

/* ─── Recently Generated Section ─── */
.sf-recent-ai-sounds {
    margin-top: 40px;
}

.sf-recent-ai-sounds h2 {
    margin-bottom: 16px;
}

.sf-recent-ai-sentinel {
    height: 1px;
}

/* ─── Rewarded Ad Modal ─── */
.sf-ad-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.sf-ad-modal.active {
    display: flex;
    animation: sfFadeUp 0.25s ease;
}

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

.sf-ad-modal-box {
    background: #2d3238;
    border-radius: 16px;
    padding: 36px 32px;
    max-width: 400px;
    width: calc(100% - 40px);
    text-align: center;
    border: 1px solid #3a3f46;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
}

.sf-ad-modal-icon {
    font-size: 2.4rem;
    color: #f0c040;
    margin-bottom: 14px;
}

.sf-ad-modal-box h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: #e0e0e0;
    margin-bottom: 8px;
}

.sf-ad-modal-box p {
    font-size: 0.9rem;
    color: #8f9ca7;
    line-height: 1.5;
    margin-bottom: 20px;
}

.sf-ad-watch-btn {
    display: block;
    width: 100%;
    padding: 14px;
    background: #e91e8c;
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.sf-ad-watch-btn:hover {
    background: #d4177f;
}

.sf-ad-watch-btn:disabled {
    background: #444;
    color: #777;
    cursor: not-allowed;
}

.sf-ad-cancel-btn {
    background: none;
    border: none;
    color: #666;
    font-size: 0.8rem;
    cursor: pointer;
    margin-top: 14px;
    padding: 6px;
    transition: color 0.2s;
}

.sf-ad-cancel-btn:hover {
    color: #999;
}

.sf-ad-loading-state {
    display: none;
    padding: 10px 0 4px;
    font-size: 0.82rem;
    color: #777;
}

.sf-ad-loading-state i {
    margin-right: 4px;
}

.sf-ad-fallback-container {
    max-width: 320px;
    overflow: hidden;
    margin: 0 auto 16px;
    border-radius: 8px;
}

/* ─── Generating Modal ─── */
.sf-generating-modal-box {
    max-width: 440px;
}

.sf-generating-ad-container {
    width: 336px;
    height: 280px;
    overflow: hidden;
    margin: 20px auto 0;
    border-radius: 8px;
    background: #1e2126;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ─── Mobile ─── */
@media (max-width: 600px) {
    .sf-soundgen-block {
        padding: 16px;
    }

    .sf-soundgen-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .sf-soundgen-block #sf-generate-btn {
        min-width: unset;
        width: 100%;
    }

    .sf-quota-inline {
        text-align: center;
        padding-left: 0;
    }

    .sf-generating-ad-container {
        width: 300px;
        height: 250px;
    }
}
