/**
 * VIRTUS AI Dedication Writer — ai-dedication.css  v1.0.0
 *
 * Scoped under .vt-ai-* and #vt-ai-* to avoid any conflict with
 * Flatsome theme, WooCommerce, or other VIRTUS plugins.
 *
 * Palette matches checkout-fields.css:
 *   Background  #0a0618 / rgba(10,6,28)
 *   Border      rgba(201,168,76,.2)  →  gold
 *   Text        #e8d9a0
 *   Text dim    rgba(232,217,160,.55)
 *   Gold        #c9a84c
 */

/* ── Trigger link ────────────────────────────────────────────────────────── */
.vt-ai-trigger-wrap {
    margin-top: 8px;
    text-align: right;
}

.vt-ai-trigger {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: none;
    border: none;
    padding: 0;
    font-size: 13px;
    color: rgba(201, 168, 76, 0.75);
    cursor: pointer;
    letter-spacing: 0.03em;
    transition: color 0.2s ease;
    font-family: inherit;
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-color: rgba(201, 168, 76, 0.35);
}

.vt-ai-trigger:hover {
    color: #c9a84c;
    text-decoration-color: rgba(201, 168, 76, 0.7);
}

/* ── Modal overlay ───────────────────────────────────────────────────────── */
.vt-ai-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(4, 2, 13, 0.88);
    display: flex;                /* toggled via JS: 'flex' / 'none' */
    align-items: center;
    justify-content: center;
    padding: 1rem;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

/* ── Modal card ──────────────────────────────────────────────────────────── */
.vt-ai-modal-card {
    background: #0a0618;
    border: 1px solid rgba(201, 168, 76, 0.28);
    border-radius: 12px;
    width: 100%;
    max-width: 580px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    display: flex;
    flex-direction: column;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.7);
}

.vt-ai-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 1.5rem 1.75rem 1rem;
    border-bottom: 1px solid rgba(201, 168, 76, 0.12);
}

.vt-ai-modal-title {
    font-family: 'Cinzel', Georgia, serif !important;
    font-size: 1.05rem !important;
    font-weight: 400 !important;
    color: #c9a84c !important;
    letter-spacing: 0.1em !important;
    text-transform: uppercase !important;
    margin: 0 0 4px !important;
    border-bottom: none !important;
}

.vt-ai-modal-sub {
    font-size: 0.8rem;
    color: rgba(232, 217, 160, 0.5);
    margin: 0;
    line-height: 1.5;
}

/* Close button */
.vt-ai-close {
    background: none;
    border: none;
    color: rgba(232, 217, 160, 0.4);
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 2px;
    flex-shrink: 0;
    transition: color 0.15s;
    font-family: inherit;
}
.vt-ai-close:hover { color: rgba(232, 217, 160, 0.8); }

/* ── Hint input row ──────────────────────────────────────────────────────── */
.vt-ai-hint-row {
    padding: 0.9rem 1.75rem 0;
}

.vt-ai-hint-input {
    width: 100%;
    background: rgba(5, 3, 14, 0.85) !important;
    border: 1px solid rgba(201, 168, 76, 0.2) !important;
    border-radius: 4px !important;
    color: #e8d9a0 !important;
    font-size: 13px !important;
    padding: 8px 12px !important;
    font-family: inherit !important;
    transition: border-color 0.2s ease !important;
    box-sizing: border-box !important;
}
.vt-ai-hint-input:focus {
    outline: none !important;
    border-color: rgba(201, 168, 76, 0.5) !important;
    box-shadow: none !important;
}
.vt-ai-hint-input::placeholder {
    color: rgba(232, 217, 160, 0.28) !important;
}

/* ── Body / content area ─────────────────────────────────────────────────── */
.vt-ai-body {
    padding: 1rem 1.75rem;
    flex: 1;
    min-height: 120px;
}

/* ── Loading ─────────────────────────────────────────────────────────────── */
.vt-ai-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 2rem 0;
    color: rgba(201, 168, 76, 0.6);
    font-size: 0.85rem;
    letter-spacing: 0.04em;
}

.vt-ai-spinner {
    width: 28px;
    height: 28px;
    border: 2px solid rgba(201, 168, 76, 0.15);
    border-top-color: #c9a84c;
    border-radius: 50%;
    animation: vt-ai-spin 0.8s linear infinite;
}

@keyframes vt-ai-spin {
    to { transform: rotate(360deg); }
}

/* ── Option cards ────────────────────────────────────────────────────────── */
.vt-ai-option {
    background: rgba(201, 168, 76, 0.04);
    border: 1px solid rgba(201, 168, 76, 0.18);
    border-radius: 8px;
    padding: 1rem 1.1rem;
    margin-bottom: 0.75rem;
    transition: border-color 0.2s ease, background 0.2s ease;
    position: relative;
}

.vt-ai-option:last-child { margin-bottom: 0; }

.vt-ai-option:hover {
    border-color: rgba(201, 168, 76, 0.4);
    background: rgba(201, 168, 76, 0.07);
}

.vt-ai-option-text {
    font-family: 'Cormorant Garamond', Georgia, serif !important;
    font-size: 1rem !important;
    font-style: italic !important;
    color: #e8d9a0 !important;
    line-height: 1.7 !important;
    margin: 0 0 0.75rem !important;
}

.vt-ai-char-count {
    font-size: 0.7rem;
    color: rgba(232, 217, 160, 0.3);
    display: block;
    margin-bottom: 0.5rem;
    font-family: monospace;
}

.vt-ai-select-btn {
    display: inline-flex;
    align-items: center;
    background: linear-gradient(135deg, #a07830, #c9a84c);
    border: none;
    border-radius: 20px;
    color: #04020d;
    font-weight: 600;
    font-size: 0.75rem;
    letter-spacing: 0.06em;
    padding: 0.4rem 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}
.vt-ai-select-btn:hover {
    background: linear-gradient(135deg, #b08840, #dab85c);
    transform: translateY(-1px);
}

/* ── Error state ─────────────────────────────────────────────────────────── */
.vt-ai-error {
    background: rgba(163, 45, 45, 0.12);
    border: 1px solid rgba(163, 45, 45, 0.3);
    border-radius: 8px;
    padding: 1rem;
    font-size: 0.85rem;
    color: #f09595;
    text-align: center;
}

/* ── Footer ──────────────────────────────────────────────────────────────── */
.vt-ai-modal-footer {
    padding: 0.75rem 1.75rem 1.25rem;
    border-top: 1px solid rgba(201, 168, 76, 0.1);
    text-align: center;
}

.vt-ai-regen-btn {
    background: none;
    border: 1px solid rgba(201, 168, 76, 0.3);
    border-radius: 20px;
    color: rgba(201, 168, 76, 0.65);
    font-size: 0.75rem;
    letter-spacing: 0.06em;
    padding: 0.35rem 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}
.vt-ai-regen-btn:hover:not(:disabled) {
    color: #c9a84c;
    border-color: rgba(201, 168, 76, 0.55);
}
.vt-ai-regen-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ── Toast notification ──────────────────────────────────────────────────── */
#vt-ai-toast {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%) translateY(1.5rem);
    background: rgba(14, 9, 2, 0.97);
    border: 1px solid rgba(201, 168, 76, 0.3);
    color: #c9a84c;
    padding: 0.6rem 1.25rem;
    border-radius: 30px;
    font-size: 0.8rem;
    letter-spacing: 0.04em;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
    z-index: 100000;
    white-space: nowrap;
    font-family: inherit;
}

#vt-ai-toast.vt-ai-toast--show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 480px) {
    .vt-ai-modal-card {
        max-height: 95vh;
        border-radius: 8px;
    }
    .vt-ai-modal-header,
    .vt-ai-hint-row,
    .vt-ai-body,
    .vt-ai-modal-footer {
        padding-left: 1.1rem;
        padding-right: 1.1rem;
    }
}