/* ===== AI Content Tools — Front-end ===== */

.act-hub, .act-wrap {
    --act-primary: #6366f1;
    --act-accent: #ec4899;
    --act-accent2: #06b6d4;
    --act-text: #1e1b2e;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    max-width: 860px;
    margin: 0 auto;
    box-sizing: border-box;
}
.act-hub *, .act-wrap *, .act-hub *::before, .act-wrap *::before { box-sizing: border-box; }

/* ---------- Tabs ---------- */
.act-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}
.act-tab {
    padding: 11px 18px;
    border: 1px solid #e6e6f2;
    border-radius: 12px;
    background: #fff;
    color: #4b5563;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}
.act-tab:hover { transform: translateY(-2px); border-color: var(--act-primary); color: var(--act-primary); }
.act-tab-active {
    background: linear-gradient(90deg, var(--act-primary), var(--act-accent));
    color: #fff;
    border-color: transparent;
    box-shadow: 0 6px 18px rgba(99,102,241,0.32);
}
.act-tab-active:hover { color: #fff; }

.act-panel { display: none; }
.act-panel-active { display: block; animation: actUp 0.35s ease both; }

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

/* ---------- Card ---------- */
.act-card {
    position: relative;
    background: #fff;
    border: 1px solid #ececf5;
    border-radius: 18px;
    padding: 26px;
    box-shadow: 0 8px 30px rgba(99,102,241,0.10);
    overflow: hidden;
    isolation: isolate;
    animation: actUp 0.4s ease both;
}
.act-card::before {
    content: "";
    position: absolute;
    top: -160px; left: -120px; right: -120px;
    height: 300px;
    z-index: -1;
    background: linear-gradient(120deg, var(--act-primary), var(--act-accent), var(--act-accent2));
    background-size: 300% 300%;
    filter: blur(70px);
    opacity: 0.16;
    animation: actMove 16s ease infinite;
}
@keyframes actMove {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.act-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    font-weight: 800;
    color: var(--act-text);
    margin-bottom: 18px;
}
.act-icon {
    font-size: 24px;
    animation: actFloat 3s ease-in-out infinite;
}
@keyframes actFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

.act-label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: #4b5563;
    margin: 12px 0 6px;
}

.act-input, .act-extra {
    width: 100%;
    padding: 13px 15px;
    font-size: 15px;
    font-family: inherit;
    border: 1px solid #e0e0ec;
    border-radius: 12px;
    outline: none;
    background: #fafaff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    resize: vertical;
}
.act-input:focus, .act-extra:focus {
    border-color: var(--act-primary);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
    background: #fff;
}

.act-charcount {
    text-align: right;
    font-size: 12px;
    color: #9ca3af;
    margin-top: 5px;
    transition: color 0.2s ease;
}
.act-charcount.act-over { color: #dc2626; font-weight: 700; }

.act-btn {
    margin-top: 16px;
    padding: 13px 30px;
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    background: linear-gradient(90deg, var(--act-primary), var(--act-accent));
    box-shadow: 0 6px 18px rgba(99,102,241,0.32);
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}
.act-btn:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(99,102,241,0.42); }
.act-btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

/* ---------- Loading ---------- */
.act-loading {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 16px;
    font-size: 14px;
    color: #6b7280;
}
.act-spinner {
    width: 18px; height: 18px;
    border: 2.5px solid rgba(99,102,241,0.25);
    border-top-color: var(--act-primary);
    border-radius: 50%;
    animation: actSpin 0.75s linear infinite;
    display: inline-block;
}
@keyframes actSpin { to { transform: rotate(360deg); } }

/* ---------- Error ---------- */
.act-error {
    margin-top: 16px;
    padding: 12px 14px;
    border-radius: 10px;
    background: #fee2e2;
    color: #b91c1c;
    font-size: 14px;
    animation: actUp 0.3s ease both;
}

/* ---------- Result ---------- */
.act-result {
    margin-top: 18px;
    border-radius: 14px;
    border: 1px solid rgba(99,102,241,0.22);
    background: linear-gradient(135deg, rgba(99,102,241,0.06), rgba(236,72,153,0.06));
    overflow: hidden;
    animation: actUp 0.4s ease both;
}
.act-result-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    font-size: 13px;
    font-weight: 800;
    color: var(--act-text);
    border-bottom: 1px solid rgba(99,102,241,0.15);
}
.act-copy {
    padding: 7px 16px;
    border: none;
    border-radius: 8px;
    background: var(--act-primary);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.15s ease;
}
.act-copy:hover { background: #4338ca; transform: translateY(-1px); }
.act-copy.act-copied { background: #16a34a; }

.act-result-text {
    padding: 18px 16px;
    font-size: 15px;
    line-height: 1.7;
    color: var(--act-text);
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* ---------- Mobile ---------- */
@media (max-width: 600px) {
    .act-card { padding: 18px; border-radius: 14px; }
    .act-btn { width: 100%; }
    .act-tab { flex: 1 1 auto; text-align: center; padding: 10px 12px; font-size: 13px; }
}
