/* ============================================
   generate-image.css
   Styles for the AI Generate Image tool
   ============================================ */

/* ── Page layout ── */
#gen-img-section .center-box {
    max-width: 820px;
    width: 100%;
}

/* ── Section title ── */
.gen-img-title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 6px;
}

.gen-img-title h2 {
    margin: 0;
    background: linear-gradient(135deg, #a78bfa, #f472b6, #60a5fa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 1.7rem;
}

.gen-img-badge {
    background: linear-gradient(135deg, #7c3aed, #db2777);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    padding: 3px 8px;
    border-radius: 20px;
    vertical-align: middle;
    text-transform: uppercase;
}

/* ── Prompt textarea ── */
#gen-img-prompt {
    width: 100%;
    min-height: 90px;
    resize: vertical;
    font-family: inherit;
    font-size: 0.95rem;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(167, 139, 250, 0.35);
    border-radius: 10px;
    color: #e2e8f0;
    padding: 12px 14px;
    box-sizing: border-box;
    transition: border-color 0.2s;
    line-height: 1.5;
}

#gen-img-prompt:focus {
    outline: none;
    border-color: rgba(167, 139, 250, 0.75);
    box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.12);
}

#gen-img-prompt::placeholder {
    color: rgba(165, 180, 252, 0.55);
}

/* ── Options row ── */
.gen-img-options-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin: 14px 0;
}

.gen-img-option-group {
    flex: 1;
    min-width: 140px;
}

.gen-img-option-group label {
    display: block;
    color: #a5b4fc;
    font-size: 0.78rem;
    margin-bottom: 5px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

/* ── Style chips (model selector) ── */
.style-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin: 12px 0;
}

.style-chip {
    cursor: pointer;
    padding: 5px 14px;
    border-radius: 20px;
    border: 1.5px solid rgba(167, 139, 250, 0.35);
    background: rgba(0, 0, 0, 0.25);
    color: #a5b4fc;
    font-size: 0.78rem;
    font-weight: 600;
    transition: all 0.2s;
    user-select: none;
}

.style-chip:hover {
    border-color: #a78bfa;
    color: #fff;
    background: rgba(167, 139, 250, 0.12);
}

.style-chip.active {
    background: linear-gradient(135deg, #7c3aed, #db2777);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 3px 12px rgba(124, 58, 237, 0.35);
}

/* ── Negative prompt collapsible ── */
#gen-img-neg-prompt {
    width: 100%;
    min-height: 55px;
    resize: vertical;
    font-family: inherit;
    font-size: 0.88rem;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    color: #e2e8f0;
    padding: 10px 12px;
    box-sizing: border-box;
    margin-top: 6px;
}

#gen-img-neg-prompt::placeholder {
    color: rgba(165, 180, 252, 0.45);
}

/* ── Generate button special ── */
#btn-generate-image {
    width: 100%;
    padding: 13px;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    background: linear-gradient(135deg, #7c3aed 0%, #db2777 50%, #0ea5e9 100%);
    border: none;
    border-radius: 10px;
    color: #fff;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.15s, box-shadow 0.2s;
    box-shadow: 0 4px 20px rgba(124, 58, 237, 0.4);
    margin-top: 4px;
    position: relative;
    overflow: hidden;
}

#btn-generate-image:hover:not(:disabled) {
    opacity: 0.92;
    transform: translateY(-1px);
    box-shadow: 0 6px 28px rgba(124, 58, 237, 0.55);
}

#btn-generate-image:active:not(:disabled) {
    transform: scale(0.98);
}

#btn-generate-image:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#btn-generate-image::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, transparent 60%);
}

/* ── Shimmer (loading animation) ── */
.gen-img-shimmer {
    width: 100%;
    aspect-ratio: 1 / 1;
    max-height: 480px;
    border-radius: 14px;
    background: linear-gradient(100deg,
            rgba(255, 255, 255, 0.04) 25%,
            rgba(167, 139, 250, 0.12) 50%,
            rgba(255, 255, 255, 0.04) 75%);
    background-size: 200% 100%;
    animation: shimmer-sweep 1.6s infinite linear;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    color: #a5b4fc;
    font-size: 0.9rem;
}

@keyframes shimmer-sweep {
    0% {
        background-position: 200% center;
    }

    100% {
        background-position: -200% center;
    }
}

.gen-img-shimmer i {
    font-size: 2.5rem;
    opacity: 0.5;
    animation: pulse-icon 1.8s ease-in-out infinite;
}

@keyframes pulse-icon {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.4;
    }

    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

/* ── Result image ── */
#gen-img-result-box {
    margin-top: 18px;
    width: 100%;
}

#gen-img-output-img {
    width: 100%;
    max-height: 520px;
    object-fit: contain;
    border-radius: 14px;
    display: block;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(167, 139, 250, 0.2);
}

/* ── Result actions ── */
.gen-img-result-actions {
    display: flex;
    gap: 10px;
    margin-top: 14px;
    flex-wrap: wrap;
}

.gen-img-result-actions button {
    flex: 1;
    min-width: 140px;
}

/* ── History grid ── */
#gen-img-history {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
}

.gen-img-history-thumb {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid rgba(167, 139, 250, 0.2);
    cursor: pointer;
    transition: border-color 0.2s, transform 0.15s;
}

.gen-img-history-thumb:hover {
    border-color: #a78bfa;
    transform: scale(1.06);
}

/* ── Prompt suggestions ── */
.prompt-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.prompt-suggestion-chip {
    font-size: 0.72rem;
    padding: 4px 10px;
    border-radius: 14px;
    border: 1px solid rgba(167, 139, 250, 0.3);
    color: #a5b4fc;
    background: rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}

.prompt-suggestion-chip:hover {
    background: rgba(167, 139, 250, 0.15);
    color: #fff;
    border-color: #a78bfa;
}

/* ── Status text ── */
#gen-img-status {
    text-align: center;
    color: #a5b4fc;
    font-size: 0.88rem;
    margin-top: 10px;
    min-height: 20px;
}

/* ── Mobile responsive ── */
@media (max-width: 600px) {
    .gen-img-options-row {
        flex-direction: column;
    }

    #gen-img-section .center-box {
        padding: 0 8px;
    }
}