@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 25%, #0f3460 50%, #533483 100%);
    min-height: 100vh; color: white; overflow-x: hidden; position: relative;
}
.container { max-width: 800px; margin: 0 auto; padding: 2rem 1rem; position: relative; z-index: 1; }
.header { text-align: center; margin-bottom: 2rem; position: relative; }
.header-top {
    min-height: 50px; /* Reserve space to prevent layout shift */
    margin-bottom: 1.5rem;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}
.header-state {
    display: none; /* Hide all states by default */
    width: 100%;
    justify-content: center;
    align-items: center;
    position: relative; /* Needed for user button positioning */
}
.title {
    font-size: clamp(3rem, 8vw, 5rem); font-weight: 900; margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #a855f7 0%, #8b5cf6 50%, #7c3aed 100%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
    letter-spacing: -0.02em;
}
.tagline { font-size: clamp(1.2rem, 3vw, 1.5rem); color: rgba(255, 255, 255, 0.8); font-weight: 300; letter-spacing: 0.01em; }
.main-card, .results-card {
    background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px; padding: 2rem; margin-bottom: 2rem; backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}
.form { display: flex; flex-direction: column; gap: 1.5rem; }
.form-group { display: flex; flex-direction: column; gap: 0.5rem; }
.custom-prompt-group, .custom-length-group { display: none; }
.label { font-weight: 600; color: rgba(255, 255, 255, 0.9); font-size: 1rem; text-align: left; }
.required { color: #f87171; }
.textarea, .select, .input {
    width: 100%; padding: 0.875rem 1rem; background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15); border-radius: 12px; color: white;
    font-size: 1rem; font-family: inherit; transition: all 0.3s ease;
}
.textarea:focus, .select:focus, .input:focus {
    outline: none; border-color: #8b5cf6; background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
}
.textarea::placeholder, .input::placeholder { color: rgba(255, 255, 255, 0.5); }
.textarea { min-height: 100px; resize: vertical; line-height: 1.5; }
.select {
    cursor: pointer; appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%23ffffff' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 1rem center; background-repeat: no-repeat; background-size: 1rem;
    padding-right: 2.5rem;
}
.select option { background: #1a1a2e; color: white; }
.select optgroup {
    font-weight: 600;
    color: #c4b5fd; /* A lighter, more readable purple */
    background: #1f1f38;
}
.turnstile-container {
    display: flex;
    justify-content: center;
    align-items: center;
}
.select option[disabled] { color: #6b7280; font-style: italic; }
.btn {
    width: 100%; padding: 1rem 1.5rem; background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    border: none; border-radius: 12px; color: white; font-size: 1rem; font-weight: 600; cursor: pointer;
    transition: all 0.3s ease; position: relative; overflow: hidden; display: flex;
    align-items: center; justify-content: center; gap: 0.5rem;
    box-shadow: 0 4px 16px rgba(139, 92, 246, 0.3);
}
.btn.auth-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(139, 92, 246, 0.5);
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
    padding: 0.6rem 1.2rem;
    border-radius: 9999px;
    display: inline-flex;
    width: auto;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}
.free-user-state .auth-btn {
    font-size: 0.9rem;
}
.btn.auth-btn:hover:not(:disabled) {
    background: rgba(139, 92, 246, 0.2);
    border-color: rgba(139, 92, 246, 0.8);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.2);
}
.btn.pro-btn { text-decoration: none; width: auto; padding: 0.75rem 2rem; font-size: 1.1rem; }
.btn:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(139, 92, 246, 0.4); }
.btn:disabled { opacity: 0.7; cursor: not-allowed; transform: none; }
.btn-loader { width: 18px; height: 18px; border: 2px solid rgba(255, 255, 255, 0.3); border-top: 2px solid white; border-radius: 50%; animation: spin 1s linear infinite; }
.btn .btn-loader { display: none; }
.btn.loading .btn-text { display: none; }
.btn.loading .btn-loader { display: block; }
.results-card { display: none; animation: fadeInUp 0.4s ease; }
.results-card.show { display: block; }
.loading { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 2rem; }
.loading-spinner { width: 40px; height: 40px; border: 3px solid rgba(255, 255, 255, 0.2); border-top: 3px solid #8b5cf6; border-radius: 50%; animation: spin 1s linear infinite; margin: 0 auto 1rem; }
.loading-text { color: rgba(255, 255, 255, 0.7); font-size: 1rem; animation: pulse 2s ease-in-out infinite; }
.result-content { display: none; flex-direction: column; gap: 2rem; }
.result-item {
    background: rgba(0, 0, 0, 0.2); border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px; padding: 1.25rem; display: flex; flex-direction: column;
    gap: 1rem; animation: fadeInUp 0.5s ease forwards; opacity: 0;
    text-align: left; line-height: 1.7; font-size: 1.05rem; color: rgba(255, 255, 255, 0.95);
}
.result-item:nth-child(2) { animation-delay: 0.1s; } .result-item:nth-child(3) { animation-delay: 0.2s; }
.copy-btn {
    align-self: flex-end; background-color: rgba(255, 255, 255, 0.1); color: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 8px; padding: 0.5rem 0.75rem;
    font-size: 0.875rem; font-weight: 500; cursor: pointer; display: inline-flex;
    align-items: center; gap: 0.5rem; transition: all 0.2s ease;
}
.copy-btn:hover { background-color: rgba(255, 255, 255, 0.2); color: white; }
.copy-btn.copied { background-color: #16a34a; border-color: #16a34a; color: white; }
.error-message { text-align: center; padding: 1rem; }
.upgrade-message {
    display: none;
    text-align: center;
    padding: 1rem;
}
.upgrade-message h2 { font-size: 1.5rem; color: #a855f7; margin-bottom: 0.5rem; }
.upgrade-message p { color: rgba(255, 255, 255, 0.8); line-height: 1.6; max-width: 450px; margin: 0 auto 1.5rem; }
.upgrade-message .upgrade-features-list {
    list-style: none;
    padding: 0;
    margin: 1.5rem auto;
    display: inline-flex;
    flex-direction: column;
    gap: 0.75rem;
    text-align: left;
}
.upgrade-message .upgrade-feature-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}
.upgrade-message .upgrade-feature-icon {
    font-size: 1.1rem;
    line-height: 1.6;
    flex-shrink: 0;
}
.upgrade-message .upgrade-feature-text {
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.6;
}
.upgrade-message .upgrade-cta {
    display: flex;
    justify-content: center;
    margin-top: 1.5rem;
}
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(248, 113, 113, 0.95);
    border: 1px solid rgba(248, 113, 113, 0.3); border-radius: 12px; padding: 1rem 1.5rem;
    color: white; font-weight: 500; z-index: 1000; transform: translateX(400px);
    opacity: 0; transition: all 0.3s ease; max-width: 350px; backdrop-filter: blur(10px);
}
.toast.info { background: rgba(59, 130, 246, 0.95); border-color: rgba(59, 130, 246, 0.3); }
.toast.success { background: rgba(34, 197, 94, 0.95); border-color: rgba(34, 197, 94, 0.3); }
.toast.show { transform: translateX(0); opacity: 1; }
.toast-content { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.toast-close { background: none; border: none; color: white; font-size: 1.5rem; cursor: pointer; padding: 0; line-height: 1; }

/* --- Pricing Popup Styles --- */
.pricing-popup-overlay {
    position: fixed; inset: 0; background: rgba(0, 0, 0, 0.7); backdrop-filter: blur(8px);
    z-index: 2000; display: flex; align-items: center; justify-content: center;
    opacity: 0; visibility: hidden; transition: all 0.3s ease;
}
.pricing-popup-overlay.show { opacity: 1; visibility: visible; }
.pricing-popup {
    background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px; padding: 2.5rem; text-align: center; max-width: 60%;
    width: 90%; position: relative; transform: scale(0.95); transition: transform 0.3s ease;
    max-height: 90vh; /* Ensure popup doesn't exceed viewport height */
    overflow-y: auto; /* Add a scrollbar ONLY if content overflows */
}

/* --- Custom Scrollbar for Popup --- */
.pricing-popup::-webkit-scrollbar {
    width: 8px;
}
.pricing-popup::-webkit-scrollbar-track {
    background: transparent; /* Make the track invisible */
}
.pricing-popup::-webkit-scrollbar-thumb {
    background-color: rgba(139, 92, 246, 0.4); /* A semi-transparent purple */
    border-radius: 10px;
    border: 2px solid transparent; /* Creates padding around the thumb */
    background-clip: content-box;
}
.pricing-popup::-webkit-scrollbar-thumb:hover {
    background-color: rgba(139, 92, 246, 0.6); /* Darken on hover */
}
.pricing-popup-overlay.show .pricing-popup { transform: scale(1); }
.popup-close-btn { position: absolute; top: 1rem; right: 1rem; background: none; border: none; color: rgba(255, 255, 255, 0.7); font-size: 1.75rem; cursor: pointer; line-height: 1; padding: 0.25rem; }
.popup-close-btn:hover { color: white; }
.popup-title { font-size: 2rem; font-weight: 700; margin-bottom: 0.75rem; background: linear-gradient(135deg, #a855f7, #8b5cf6); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.popup-features {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 2.5rem;
    text-align: left;
    display: inline-block;
}
.popup-features ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.popup-features li { display: flex; align-items: flex-start; gap: 0.75rem; line-height: 1.5; }
.popup-features li svg { flex-shrink: 0; color: #34d399; margin-top: 2px; }
.popup-features li strong { color: white; }
.lifetime-offer {
    display: flex; align-items: baseline; justify-content: center;
    gap: 0.75rem; margin-bottom: 1.5rem;
}
.lifetime-offer .price { font-size: 3rem; font-weight: 800; color: white; line-height: 1; }
.lifetime-offer .currency-badge {
    background: #8b5cf6; color: white; font-size: 1rem; font-weight: 600;
    padding: 0.3rem 0.6rem; border-radius: 8px;
}

/* --- LTD Popup Styles --- */
.ltd-popup {
    border: 2px solid #a855f7;
    box-shadow: 0 10px 50px rgba(139, 92, 246, 0.5);
    padding-top: 0;
}
.ltd-banner {
    background: linear-gradient(135deg, #a855f7, #8b5cf6);
    color: white;
    padding: 0.75rem 1rem;
    border-radius: 14px 14px 0 0;
    margin: 0 -2.5rem 2rem -2.5rem;
    font-weight: 600;
    font-size: 1.1rem;
}
.ltd-subtitle {
    color: rgba(255, 255, 255, 0.8);
    margin: -0.5rem auto 1.5rem;
    max-width: 400px;
    line-height: 1.6;
}
.ltd-subtitle .highlight-usp {
    color: #34d399; /* A bright, attention-grabbing green */
    font-weight: 700;
    text-shadow: 0 0 10px rgba(52, 211, 153, 0.4); /* Add a subtle glow */
}
.ltd-features ul {
    gap: 0.8rem;
}
.ltd-features li {
    font-size: 1.05rem;
}
.ltd-cta-container {
    display: flex;
    justify-content: center;
    margin-top: 2rem;
    margin-bottom: 1rem;
}
.ltd-footer-note {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
    font-style: italic;
}
@media (max-width: 768px) {
    .ltd-banner { margin: 0 -1.5rem 1.5rem -1.5rem; border-radius: 10px 10px 0 0; }
}


/* --- Pro User Header Styles --- */
.pro-message {
    font-size: 1.1rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
    padding: 0.5rem 0;
}
.user-button-corner {
    position: absolute;
    top: 50%;
    right: 0;
    transform: translateY(-50%);
}

.cl-userButton-root { box-shadow: none !important; }
.cl-userButton-root .cl-userButton-avatarBox {
    width: 44px !important;
    height: 44px !important;
    transition: all 0.3s ease;
}
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.6; } }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 768px) {
    .cl-userButton-root .cl-userButton-avatarBox {
        width: 38px !important;
        height: 38px !important;
    }
    .container { padding: 1.5rem 1rem; }
    .main-card, .results-card { padding: 1.5rem; border-radius: 12px; }
    .header { margin-bottom: 2rem; } .form { gap: 1.25rem; }
    .header-top { min-height: 40px; margin-bottom: 1rem; }
    .pro-message { font-size: 0.9rem; text-align: center; width: 100%; }
    .user-button-corner { top: 0; right: 0; transform: none; }
    .toast { right: 10px; left: 10px; max-width: none; transform: translateY(-100px); }
    .toast.show { transform: translateY(0); }
}
@media (max-width: 480px) {
    .main-card, .results-card { padding: 1.25rem; }
    .btn { padding: 0.875rem; font-size: 0.95rem; }
}
.footer {
    text-align: center;
    padding: 2rem 1rem;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
}

/* For desktops and larger screens */
@media (min-width: 769px) {
  .pricing-popup {
    max-width: 60%;
  }
}

/* For smaller screens (phones/tablets) */
@media (max-width: 768px) {
  .pricing-popup {
    width: 90%;
    max-width: 90%;
  }
}

/* Added spacing for privacy terms and contact pages */
.main-card section {
    margin-bottom: 2rem;
}

.main-card section h2 {
    margin-bottom: 1rem;
}

.main-card section p,
.main-card section ul {
    margin-bottom: 1rem;
}

/* Fix bullet points structure inside main content */
.main-card section ul {
    padding-left: 1.5rem; /* indent bullet points */
    list-style-position: outside;
}

.main-card section ul li {
    margin-bottom: 0.5rem; /* space between bullet points */
}

/* Improve clickable link contrast */
.main-card section a {
    color: #c084fc; /* brighter purple for better contrast */
    text-decoration: underline;
    transition: color 0.3s ease;
}

.main-card section a:hover,
.main-card section a:focus {
    color: #a855f7; /* darker purple on hover/focus */
    outline: none;
    text-decoration: none;
}
