/* =======================================================
   SECTION 2 : AI PROMPT WORKSPACE
======================================================= */
.prompt-workspace {
    position: relative;
    padding: 110px 5.5%;
    overflow: hidden;
    background:
        radial-gradient(circle at 8% 8%, rgba(46, 196, 255, 0.09), transparent 27%),
        radial-gradient(circle at 92% 90%, rgba(46, 213, 115, 0.06), transparent 28%),
        linear-gradient(180deg, #07111d 0%, #091928 100%);
}
.prompt-workspace::before {
    position: absolute;
    inset: 0;
    content: "";
    opacity: 0.25;
    background-image:
        linear-gradient(rgba(98, 206, 255, 0.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(98, 206, 255, 0.045) 1px, transparent 1px);
    background-size: 56px 56px;
    mask-image: linear-gradient(to bottom, transparent, #000 18%, #000 82%, transparent);
    pointer-events: none;
}
/* ---------- Shared section header ---------- */
.section-header {
    position: relative;
    z-index: 1;
    width: min(760px, 100%);
    margin: 0 auto 54px;
    text-align: center;
}
.section-tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    padding: 8px 14px;
    color: var(--cyan-light);
    border: 1px solid rgba(46, 196, 255, 0.27);
    border-radius: 999px;
    background: rgba(46, 196, 255, 0.07);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}
.section-header h2 {
    margin: 0;
    color: var(--text-main);
    font-size: clamp(2rem, 4vw, 3.2rem);
    font-weight: 700;
    line-height: 1.14;
    letter-spacing: -0.045em;
}
.section-header p {
    margin: 18px auto 0;
    color: var(--text-muted);
    font-size: 0.98rem;
    line-height: 1.8;
}
/* ---------- Workspace layout ---------- */
.workspace-grid {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(380px, 0.92fr);
    gap: 24px;
    width: min(1380px, 100%);
    margin: 0 auto;
}
.workspace-left,
.workspace-right {
    display: flex;
    flex-direction: column;
    gap: 24px;
}
/* ---------- Shared glass card ---------- */
.glass-card {
    position: relative;
    overflow: hidden;
    padding: 25px;
    border: 1px solid rgba(126, 215, 255, 0.17);
    border-radius: 16px;
    background:
        linear-gradient(145deg, rgba(17, 43, 64, 0.78), rgba(8, 25, 41, 0.82));
    box-shadow:
        0 18px 55px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.035);
    backdrop-filter: blur(16px);
}
.glass-card::before {
    position: absolute;
    top: 0;
    left: 8%;
    width: 84%;
    height: 1px;
    content: "";
    opacity: 0.6;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(110, 221, 255, 0.36),
        transparent
    );
}
.glass-card h3 {
    margin: 0;
    color: #eafaff;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: -0.018em;
}
.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}
.card-header h3 {
    display: flex;
    align-items: center;
    gap: 10px;
}
.card-header .icon {
    width: 21px;
    height: 21px;
    color: var(--cyan);
}
/* ---------- Prompt editor ---------- */
.clear-btn {
    padding: 7px 12px;
    color: #a8c8d8;
    border: 1px solid rgba(154, 213, 240, 0.2);
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.025);
    font-size: 0.72rem;
    cursor: pointer;
    transition: 0.22s ease;
}
.clear-btn:hover {
    color: #ffffff;
    border-color: rgba(46, 196, 255, 0.52);
    background: rgba(46, 196, 255, 0.11);
}
#promptInput {
    display: block;
    width: 100%;
    min-height: 330px;
    padding: 18px;
    resize: vertical;
    outline: none;
    color: #dff4ff;
    border: 1px solid rgba(133, 213, 249, 0.16);
    border-radius: 11px;
    background:
        linear-gradient(rgba(46, 196, 255, 0.026) 1px, transparent 1px),
        linear-gradient(90deg, rgba(46, 196, 255, 0.026) 1px, transparent 1px),
        rgba(3, 17, 29, 0.54);
    background-size: 28px 28px;
    font-family: "Courier New", monospace;
    font-size: 0.83rem;
    line-height: 1.75;
    transition:
        border-color 0.25s ease,
        box-shadow 0.25s ease,
        background 0.25s ease;
}
#promptInput::placeholder {
    color: rgba(163, 197, 214, 0.6);
}
#promptInput:focus {
    border-color: rgba(46, 196, 255, 0.68);
    background-color: rgba(3, 19, 32, 0.78);
    box-shadow:
        0 0 0 3px rgba(46, 196, 255, 0.09),
        0 0 28px rgba(46, 196, 255, 0.09);
}
.prompt-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 18px;
    margin-top: 12px;
    color: #7897a9;
    font-size: 0.7rem;
}
/* ---------- Prompt suggestions ---------- */
.suggestions h3 {
    margin-bottom: 18px;
}
.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.chip {
    padding: 9px 13px;
    color: #b9d9e8;
    border: 1px solid rgba(135, 211, 244, 0.16);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.025);
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition:
        transform 0.22s ease,
        color 0.22s ease,
        border-color 0.22s ease,
        background 0.22s ease;
}
.chip:hover {
    transform: translateY(-2px);
    color: #eafaff;
    border-color: rgba(46, 196, 255, 0.48);
    background: rgba(46, 196, 255, 0.12);
}
/* ---------- Form configuration ---------- */
.workspace-right .glass-card {
    padding: 25px;
}
.workspace-right .glass-card > h3 {
    margin-bottom: 20px;
}
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}
.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.form-group label {
    color: #a8c5d4;
    font-size: 0.73rem;
    font-weight: 500;
}
.form-group select,
.form-group input {
    width: 100%;
    min-height: 43px;
    padding: 0 12px;
    outline: none;
    color: #d7eff9;
    border: 1px solid rgba(135, 211, 244, 0.17);
    border-radius: 8px;
    background: rgba(3, 18, 30, 0.55);
    font-size: 0.77rem;
    transition:
        border-color 0.22s ease,
        box-shadow 0.22s ease;
}
.form-group select {
    appearance: none;
    cursor: pointer;
    background-image:
        linear-gradient(45deg, transparent 50%, #80bbd3 50%),
        linear-gradient(135deg, #80bbd3 50%, transparent 50%);
    background-position:
        calc(100% - 17px) 18px,
        calc(100% - 12px) 18px;
    background-repeat: no-repeat;
    background-size: 5px 5px;
}
.form-group select:focus,
.form-group input:focus {
    border-color: rgba(46, 196, 255, 0.65);
    box-shadow: 0 0 0 3px rgba(46, 196, 255, 0.08);
}
/* ---------- Toggle and export controls ---------- */
.toggle-group,
.export-grid {
    display: grid;
    gap: 11px;
}
.toggle-group label,
.export-grid label {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #b8d2df;
    font-size: 0.79rem;
    line-height: 1.4;
    cursor: pointer;
}
.export-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
.toggle-group input,
.export-grid input {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--cyan);
    cursor: pointer;
}
/* ---------- Action panel ---------- */
.action-panel {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0 0;
}
.generate-btn {
    display: inline-flex;
    flex: 1;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 49px;
    padding: 13px 20px;
    color: #03111b;
    border: 0;
    border-radius: 10px;
    background: linear-gradient(135deg, #67dfff, #2ec4ff);
    font-size: 0.86rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 12px 28px rgba(46, 196, 255, 0.2);
    transition:
        transform 0.24s ease,
        box-shadow 0.24s ease,
        filter 0.24s ease;
}
.generate-btn:hover {
    transform: translateY(-3px);
    filter: brightness(1.07);
    box-shadow: 0 18px 35px rgba(46, 196, 255, 0.34);
}
.btn-icon {
    font-size: 1rem;
}
.secondary-action {
    min-height: 49px;
    padding: 12px 17px;
    color: #c4dfe9;
    border: 1px solid rgba(140, 215, 246, 0.22);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.035);
    font-size: 0.77rem;
    font-weight: 500;
    cursor: pointer;
    transition: 0.22s ease;
}
.secondary-action:hover {
    color: #ffffff;
    border-color: rgba(46, 196, 255, 0.52);
    background: rgba(46, 196, 255, 0.1);
}
/* ---------- Prompt history ---------- */
.history-card {
    position: relative;
    z-index: 1;
    width: min(1380px, 100%);
    margin: 28px auto 0;
    padding: 25px;
    border: 1px solid rgba(126, 215, 255, 0.17);
    border-radius: 16px;
    background: rgba(9, 29, 46, 0.67);
    box-shadow: 0 18px 55px rgba(0, 0, 0, 0.16);
    backdrop-filter: blur(16px);
}
.history-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}
.history-header h3 {
    margin: 0;
    color: #eafaff;
    font-size: 1rem;
    font-weight: 600;
}
.history-header button,
.history-item button {
    color: var(--cyan-light);
    border: 0;
    background: transparent;
    font-size: 0.74rem;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.2s ease;
}
.history-header button:hover,
.history-item button:hover {
    color: #ffffff;
}
.history-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}
.history-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 86px;
    padding: 15px 16px;
    border: 1px solid rgba(129, 209, 243, 0.13);
    border-radius: 10px;
    background: rgba(2, 15, 26, 0.35);
    transition:
        transform 0.22s ease,
        border-color 0.22s ease,
        background 0.22s ease;
}
.history-item:hover {
    transform: translateY(-3px);
    border-color: rgba(46, 196, 255, 0.35);
    background: rgba(46, 196, 255, 0.055);
}
.history-item strong {
    display: block;
    color: #dff5ff;
    font-size: 0.79rem;
    font-weight: 600;
}
.history-item p {
    margin: 5px 0 0;
    color: #87a9ba;
    font-size: 0.69rem;
    line-height: 1.45;
}
.history-item button {
    flex-shrink: 0;
    padding: 7px 9px;
    border: 1px solid rgba(46, 196, 255, 0.21);
    border-radius: 6px;
    background: rgba(46, 196, 255, 0.06);
}
/* ---------- Responsive workspace ---------- */
@media (max-width: 1050px) {
    .prompt-workspace {
        padding: 88px 4%;
    }
    .workspace-grid {
        grid-template-columns: 1fr;
    }
    .workspace-right {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: start;
    }
    .workspace-right .action-panel {
        grid-column: 1 / -1;
    }
    .history-list {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 700px) {
    .prompt-workspace {
        padding: 72px 22px;
    }
    .section-header {
        margin-bottom: 38px;
        text-align: left;
    }
    .section-header p {
        margin-right: 0;
        margin-left: 0;
    }
    .glass-card,
    .history-card {
        padding: 19px;
        border-radius: 13px;
    }
    .workspace-grid,
    .workspace-left,
    .workspace-right {
        gap: 16px;
    }
    .workspace-right {
        display: flex;
    }
    .form-grid,
    .export-grid {
        grid-template-columns: 1fr;
    }
    #promptInput {
        min-height: 270px;
        padding: 15px;
        font-size: 0.75rem;
    }
    .prompt-footer {
        justify-content: space-between;
        gap: 8px;
        font-size: 0.64rem;
    }
    .action-panel {
        flex-direction: column;
        align-items: stretch;
    }
    .generate-btn,
    .secondary-action {
        width: 100%;
    }
    .history-item {
        min-height: auto;
    }
}
