/* ==========================================================================
   AI Tagline Generator — Public Styles v4
   Font: Roboto Condensed | Orange search border | Black input | Body-level modals
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Roboto+Condensed:ital,wght@0,300;0,400;0,600;0,700;0,800;1,400&display=swap');

/* ── Wrapper: just a container, NO overflow:hidden, NO position:relative clip ── */
.atg-wrapper {
    font-family: 'Roboto Condensed', Arial, sans-serif;
    color: #1a1a2e;
    max-width: 760px;
    margin: 0 auto;
}

.atg-wrapper *,
.atg-wrapper *::before,
.atg-wrapper *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ── Search Bar Container ───────────────────────────────────────────────────── */
.atg-search-wrap {
    background: #fff;
    border-radius: 20px;
    padding: 20px 24px 16px;
    box-shadow: 0 4px 24px rgba(255, 100, 0, 0.10);
}

/* ── Single Search Bar — Orange border, black text, grey placeholder ─────── */
.atg-search-bar {
    display: flex;
    align-items: center;
    background: #fff;
    border: 2.5px solid #ff6400;
    border-radius: 100px;
    padding: 6px 6px 6px 20px;
    gap: 10px;
    transition: box-shadow 0.2s;
}

.atg-search-bar:focus-within {
    box-shadow: 0 0 0 4px rgba(255, 100, 0, 0.14);
}

.atg-search-icon {
    color: #ff6400;
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.atg-input.atg-field-query {
    flex: 1;
    border: none;
    background: transparent;
    font-family: 'Roboto Condensed', Arial, sans-serif;
    font-size: 16px;
    font-weight: 400;
    color: #000000;
    outline: none;
    padding: 10px 0;
    min-width: 0;
}

.atg-input.atg-field-query::placeholder {
    color: #9ca3af;
    font-weight: 400;
}

/* ── Generate Button ────────────────────────────────────────────────────────── */
.atg-btn-generate {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 22px;
    background: linear-gradient(135deg, #ff6400 0%, #ff9500 100%);
    color: #fff;
    border: none;
    border-radius: 100px;
    font-family: 'Roboto Condensed', Arial, sans-serif;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: opacity 0.2s, transform 0.15s, box-shadow 0.2s;
    box-shadow: 0 4px 14px rgba(255, 100, 0, 0.32);
    letter-spacing: 0.3px;
}

.atg-btn-generate:hover {
    opacity: 0.92;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(255, 100, 0, 0.42);
}

.atg-btn-generate:active { transform: scale(0.97); }
.atg-btn-arrow { transition: transform 0.2s; }
.atg-btn-generate:hover .atg-btn-arrow { transform: translateX(3px); }

/* ── Search Meta (hint + credit notice) ─────────────────────────────────────── */
.atg-search-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 10px;
    padding: 0 4px;
}

.atg-hint {
    font-family: 'Roboto Condensed', Arial, sans-serif;
    font-size: 12px;
    color: #bbb;
}

.atg-hint em { font-style: italic; color: #aaa; }

.atg-credit-notice {
    font-family: 'Roboto Condensed', Arial, sans-serif;
    font-size: 12px;
    color: #888;
    text-align: right;
}

/* ── Results ───────────────────────────────────────────────────────────────── */
.atg-results {
    display: none;
    margin-top: 24px;
}

.atg-results.atg-visible { display: block; }

.atg-results-header {
    text-align: center;
    margin-bottom: 20px;
}

.atg-results-header h3 {
    font-family: 'Roboto Condensed', Arial, sans-serif;
    font-size: 1.45rem;
    font-weight: 800;
    color: #1a1a2e;
    margin-bottom: 4px;
}

.atg-results-brand {
    font-family: 'Roboto Condensed', Arial, sans-serif;
    font-size: 13px;
    color: #ff6400;
    font-weight: 600;
}

/* ── 3×3 Grid ──────────────────────────────────────────────────────────────── */
.atg-taglines-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

@media (max-width: 600px)  { .atg-taglines-grid { grid-template-columns: 1fr; } }
@media (min-width: 601px) and (max-width: 860px) { .atg-taglines-grid { grid-template-columns: repeat(2, 1fr); } }

.atg-tagline-card {
    background: #fff;
    border: 2px solid #ffe8d6;
    border-radius: 14px;
    padding: 16px 14px 12px;
    cursor: pointer;
    transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-height: 90px;
    animation: atg-card-in 0.38s ease both;
    box-shadow: 0 2px 10px rgba(255, 100, 0, 0.06);
}

.atg-tagline-card:nth-child(1) { animation-delay: 0.04s; }
.atg-tagline-card:nth-child(2) { animation-delay: 0.08s; }
.atg-tagline-card:nth-child(3) { animation-delay: 0.12s; }
.atg-tagline-card:nth-child(4) { animation-delay: 0.16s; }
.atg-tagline-card:nth-child(5) { animation-delay: 0.20s; }
.atg-tagline-card:nth-child(6) { animation-delay: 0.24s; }
.atg-tagline-card:nth-child(7) { animation-delay: 0.28s; }
.atg-tagline-card:nth-child(8) { animation-delay: 0.32s; }
.atg-tagline-card:nth-child(9) { animation-delay: 0.36s; }

@keyframes atg-card-in {
    from { opacity: 0; transform: translateY(10px) scale(0.96); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.atg-tagline-card:hover {
    border-color: #ff6400;
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(255, 100, 0, 0.16);
}

.atg-tagline-card.atg-copied { border-color: #38a169; background: #f0fff4; }

.atg-tagline-num {
    font-family: 'Roboto Condensed', Arial, sans-serif;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #ffb380;
}

.atg-tagline-text {
    font-family: 'Roboto Condensed', Arial, sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: #2d3748;
    line-height: 1.5;
    flex: 1;
}

.atg-tagline-copy {
    font-family: 'Roboto Condensed', Arial, sans-serif;
    font-size: 11px;
    color: #ff6400;
    opacity: 0;
    transition: opacity 0.2s;
}

.atg-tagline-card:hover .atg-tagline-copy { opacity: 1; }

/* ── Results Actions ───────────────────────────────────────────────────────── */
.atg-results-actions {
    display: flex;
    gap: 10px;
    margin-top: 18px;
    justify-content: center;
    flex-wrap: wrap;
}

.atg-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 11px 20px;
    border-radius: 100px;
    font-family: 'Roboto Condensed', Arial, sans-serif;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.15s;
    border: none;
    letter-spacing: 0.2px;
}

.atg-btn-copy-all {
    background: #2d3748;
    color: #fff;
    box-shadow: 0 3px 10px rgba(45,55,72,0.22);
}
.atg-btn-copy-all:hover { background: #1a202c; transform: translateY(-1px); }

.atg-btn-regenerate {
    background: #fff;
    color: #ff6400;
    border: 2px solid #ffe8d6;
}
.atg-btn-regenerate:hover { background: #fff5ef; border-color: #ff6400; transform: translateY(-1px); }

/* ── Credits CTA ───────────────────────────────────────────────────────────── */
.atg-credits-cta {
    margin-top: 22px;
    border-radius: 16px;
    background: linear-gradient(135deg, #fff5ef 0%, #fff9f5 100%);
    border: 1.5px solid #ffd5b0;
}

.atg-credits-cta-inner {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 22px;
    flex-wrap: wrap;
}

.atg-credits-cta-icon { font-size: 32px; flex-shrink: 0; }

.atg-credits-cta-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 160px;
}

.atg-credits-cta-text strong {
    font-family: 'Roboto Condensed', Arial, sans-serif;
    font-size: 14px;
    font-weight: 800;
    color: #1a1a2e;
}

.atg-credits-cta-text span {
    font-family: 'Roboto Condensed', Arial, sans-serif;
    font-size: 12.5px;
    color: #888;
}

.atg-btn-topup {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 11px 18px;
    background: linear-gradient(135deg, #ff6400 0%, #ff9500 100%);
    color: #fff;
    border: none;
    border-radius: 100px;
    font-family: 'Roboto Condensed', Arial, sans-serif;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.2s;
    box-shadow: 0 4px 12px rgba(255,100,0,0.28);
    flex-shrink: 0;
}
.atg-btn-topup:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(255,100,0,0.38); }

/* ── Toast ─────────────────────────────────────────────────────────────────── */
.atg-copy-toast {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%) translateY(14px);
    background: #1a202c;
    color: #fff;
    padding: 10px 20px;
    border-radius: 100px;
    font-family: 'Roboto Condensed', Arial, sans-serif;
    font-size: 13px;
    font-weight: 600;
    z-index: 9999999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s, transform 0.22s;
    white-space: nowrap;
}

.atg-copy-toast.atg-show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ── MODALS (appended to <body> by JS) ─────────────────────────────────────── */
.atg-modal-overlay {
    position: fixed !important;
    inset: 0 !important;
    background: rgba(10, 10, 30, 0.65) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
    z-index: 9999998 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 20px !important;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.26s ease;
}

.atg-modal-overlay.atg-open {
    opacity: 1 !important;
    pointer-events: all !important;
}

.atg-modal-overlay--bare {
    background: rgba(10, 10, 30, 0.5) !important;
    backdrop-filter: blur(4px) !important;
}

.atg-modal {
    background: #fff;
    border-radius: 22px;
    padding: 42px 38px 34px;
    max-width: 440px;
    width: 100%;
    position: relative;
    box-shadow: 0 28px 72px rgba(0,0,0,0.22);
    transform: translateY(24px) scale(0.96);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.atg-modal-overlay.atg-open .atg-modal {
    transform: translateY(0) scale(1);
}

.atg-modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    background: #f4f5f8;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    transition: background 0.2s, color 0.2s;
}
.atg-modal-close:hover { background: #ffe4d0; color: #ff6400; }

.atg-modal-header {
    text-align: center;
    margin-bottom: 22px;
}

.atg-modal-icon { font-size: 42px; display: block; margin-bottom: 10px; }

.atg-modal-header h3 {
    font-family: 'Roboto Condensed', Arial, sans-serif;
    font-size: 1.3rem;
    font-weight: 800;
    color: #1a1a2e;
    margin-bottom: 8px;
}

.atg-modal-header p {
    font-family: 'Roboto Condensed', Arial, sans-serif;
    font-size: 14px;
    color: #666;
    line-height: 1.6;
}

/* ── Auth buttons ──────────────────────────────────────────────────────────── */
.atg-auth-actions { display: flex; flex-direction: column; gap: 10px; align-items: center; }

.atg-btn-auth {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 14px 22px;
    border-radius: 12px;
    font-family: 'Roboto Condensed', Arial, sans-serif;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
    transition: transform 0.15s, box-shadow 0.2s;
    cursor: pointer;
}

.atg-btn-auth-primary {
    background: linear-gradient(135deg, #ff6400 0%, #ff9500 100%);
    color: #fff !important;
    box-shadow: 0 5px 18px rgba(255,100,0,0.32);
}
.atg-btn-auth-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(255,100,0,0.40); }

.atg-btn-auth-secondary {
    background: #fff;
    color: #ff6400 !important;
    border: 2px solid #ff6400;
}
.atg-btn-auth-secondary:hover { background: #fff5ef; transform: translateY(-1px); }

.atg-auth-divider {
    font-family: 'Roboto Condensed', Arial, sans-serif;
    font-size: 12px;
    color: #bbb;
    margin: 2px 0;
}

.atg-modal-note {
    font-family: 'Roboto Condensed', Arial, sans-serif;
    font-size: 11.5px;
    color: #ccc;
    text-align: center;
    margin-top: 14px;
}

/* ── Credits info ──────────────────────────────────────────────────────────── */
.atg-credits-info {
    background: #fff8f3;
    border: 1.5px solid #ffddc0;
    border-radius: 12px;
    padding: 14px 18px;
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.atg-balance-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: 'Roboto Condensed', Arial, sans-serif;
    font-size: 13.5px;
    color: #555;
}

.atg-balance-val { font-weight: 700; color: #ff6400; font-size: 16px; }
.atg-balance-cost { color: #c0392b; font-weight: 600; }

/* ── Generating spinner ────────────────────────────────────────────────────── */
.atg-generating-box {
    background: #fff;
    border-radius: 18px;
    padding: 38px 48px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,0.18);
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1);
}
.atg-modal-overlay.atg-open .atg-generating-box { transform: scale(1); }

.atg-generating-box p {
    font-family: 'Roboto Condensed', Arial, sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: #666;
    margin-top: 16px;
}

.atg-spinner-lg {
    width: 48px;
    height: 48px;
    animation: atg-spin 0.9s linear infinite;
}

/* ── Animations ────────────────────────────────────────────────────────────── */
@keyframes atg-spin { to { transform: rotate(360deg); } }
@keyframes atg-shake {
    0%,100% { transform: translateX(0); }
    20%,60%  { transform: translateX(-5px); }
    40%,80%  { transform: translateX(5px); }
}
.atg-shake { animation: atg-shake .38s ease !important; border-color: #e53e3e !important; }

/* ── Responsive ────────────────────────────────────────────────────────────── */
@media (max-width: 540px) {
    .atg-search-wrap { padding: 16px 14px 12px; }
    .atg-search-bar { border-radius: 16px; padding: 8px 8px 8px 14px; flex-wrap: wrap; gap: 8px; }
    .atg-btn-generate { width: 100%; justify-content: center; border-radius: 10px; }
    .atg-search-meta { flex-direction: column; align-items: flex-start; }
    .atg-credit-notice { text-align: left; }
    .atg-modal { padding: 32px 18px 26px; }
    .atg-results-actions { flex-direction: column; }
    .atg-results-actions .atg-btn { width: 100%; justify-content: center; }
    .atg-credits-cta-inner { flex-direction: column; text-align: center; }
    .atg-btn-topup { width: 100%; justify-content: center; }
}
