/* ========================================
   HOOKY BIO - STYLES
   Matching Hooky Shorts design language
   ======================================== */

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

:root {
    /* Colors - Dark Theme matching Hooky Shorts */
    --bg-primary: #0d0d0f;
    --bg-secondary: #151518;
    --bg-input: #1a1a1f;
    --bg-card: #1f1f24;

    --text-primary: #ffffff;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;

    /* Accent - Pink/Coral/Orange gradient like Hooky Shorts */
    --accent-pink: #f472b6;
    --accent-coral: #fb7185;
    --accent-orange: #fb923c;
    --accent-purple: #a855f7;

    --gradient-accent: linear-gradient(135deg, var(--accent-pink) 0%, var(--accent-coral) 50%, var(--accent-orange) 100%);
    --gradient-button: linear-gradient(135deg, var(--accent-coral) 0%, var(--accent-pink) 100%);

    --border-color: rgba(255, 255, 255, 0.08);
    --border-active: rgba(251, 113, 133, 0.5);

    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;

    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-full: 100px;

    /* Transitions */
    --transition: 200ms ease;

    /* Safe Areas */
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-family);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
    min-height: 100dvh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Subtle gradient overlay */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 300px;
    background: radial-gradient(ellipse at top center, rgba(168, 85, 247, 0.08) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

/* ========================================
   APP CONTAINER
   ======================================== */
.app-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
    padding: var(--space-md);
    padding-top: calc(var(--safe-top) + var(--space-md));
    padding-bottom: calc(var(--safe-bottom) + var(--space-xl));
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}

/* ========================================
   HEADER
   ======================================== */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md) 0;
    margin-bottom: var(--space-lg);
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.logo-icon {
    width: 64px;
    height: 64px;
    object-fit: contain;
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.logo-accent {
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.pro-badge {
    padding: 4px 10px;
    background: var(--gradient-accent);
    border-radius: var(--radius-full);
    font-size: 0.6875rem;
    font-weight: 700;
    color: var(--bg-primary);
    letter-spacing: 0.05em;
}

/* ========================================
   MAIN CONTENT
   ======================================== */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

/* ========================================
   INPUT GROUPS
   ======================================== */
.input-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.input-label {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.1em;
}

/* Text Input */
.text-input {
    width: 100%;
    padding: 14px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.9375rem;
    font-family: var(--font-family);
    transition: all var(--transition);
}

.text-input::placeholder {
    color: var(--text-muted);
}

.text-input:focus {
    outline: none;
    border-color: var(--border-active);
    box-shadow: 0 0 0 3px rgba(251, 113, 133, 0.1);
}

/* Chip Group */
.chip-group {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
}

.chip {
    padding: 10px 16px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    font-size: 0.8125rem;
    font-weight: 500;
    font-family: var(--font-family);
    cursor: pointer;
    transition: all var(--transition);
}

.chip:hover {
    background: var(--bg-card);
    border-color: rgba(255, 255, 255, 0.15);
    color: var(--text-primary);
}

.chip.active {
    background: var(--gradient-button);
    border-color: transparent;
    color: var(--text-primary);
    font-weight: 600;
}

.chip.special {
    background: rgba(251, 146, 60, 0.15);
    border-color: rgba(251, 146, 60, 0.3);
    color: var(--accent-orange);
}

.chip.special.active {
    background: var(--accent-orange);
    border-color: transparent;
    color: var(--bg-primary);
}

/* ========================================
   GENERATE BUTTON
   ======================================== */
.generate-btn {
    width: 100%;
    padding: 18px var(--space-lg);
    background: var(--gradient-button);
    border: none;
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 600;
    font-family: var(--font-family);
    cursor: pointer;
    transition: all var(--transition);
    margin-top: var(--space-md);
    position: relative;
    overflow: hidden;
}

.generate-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.generate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(251, 113, 133, 0.3);
}

.generate-btn:hover::before {
    left: 100%;
}

.generate-btn:active {
    transform: translateY(0);
}

.generate-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.generate-btn:disabled:hover::before {
    left: -100%;
}

.btn-loader {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.hidden {
    display: none !important;
}

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

/* ========================================
   RESULTS SECTION
   ======================================== */
.results-section {
    margin-top: var(--space-lg);
    padding-top: var(--space-lg);
    border-top: 1px solid var(--border-color);
    animation: fadeInUp 0.4s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-md);
}

.results-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
}

.copy-all-btn {
    padding: 8px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 500;
    font-family: var(--font-family);
    cursor: pointer;
    transition: all var(--transition);
}

.copy-all-btn:hover {
    background: var(--bg-input);
    color: var(--text-primary);
}

.copy-all-btn.copied {
    background: rgba(34, 197, 94, 0.15);
    border-color: rgba(34, 197, 94, 0.3);
    color: #22c55e;
}

.results-container {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

/* Result Card */
.result-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    transition: all var(--transition);
}

.result-card:hover {
    border-color: rgba(255, 255, 255, 0.12);
}

.result-label {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--accent-pink);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: var(--space-sm);
}

.result-content {
    font-size: 0.9375rem;
    color: var(--text-primary);
    line-height: 1.7;
    white-space: pre-wrap;
    word-break: break-word;
}

.result-actions {
    display: flex;
    gap: var(--space-sm);
    margin-top: var(--space-md);
    padding-top: var(--space-md);
    border-top: 1px solid var(--border-color);
}

.copy-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.8125rem;
    font-weight: 500;
    font-family: var(--font-family);
    cursor: pointer;
    transition: all var(--transition);
}

.copy-btn:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}

.copy-btn.copied {
    background: rgba(34, 197, 94, 0.15);
    border-color: rgba(34, 197, 94, 0.3);
    color: #22c55e;
}

.copy-btn svg {
    width: 14px;
    height: 14px;
}

/* Variations */
.variations-wrapper {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.variation-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: var(--space-md);
}

.variation-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-sm);
}

.variation-number {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.variation-copy-btn {
    padding: 6px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 0.6875rem;
    font-weight: 500;
    font-family: var(--font-family);
    cursor: pointer;
    transition: all var(--transition);
}

.variation-copy-btn:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}

.variation-copy-btn.copied {
    background: rgba(34, 197, 94, 0.15);
    border-color: rgba(34, 197, 94, 0.3);
    color: #22c55e;
}

.variation-content {
    font-size: 0.9375rem;
    color: var(--text-primary);
    line-height: 1.7;
    white-space: pre-wrap;
    word-break: break-word;
}

/* ========================================
   FOOTER
   ======================================== */
.footer {
    margin-top: auto;
    padding-top: var(--space-xl);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
}

.footer-link {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-decoration: none;
    transition: color var(--transition);
}

.footer-link:hover {
    color: var(--text-secondary);
}

.footer-text {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ========================================
   TOAST NOTIFICATION
   ======================================== */
.toast {
    position: fixed;
    bottom: calc(var(--safe-bottom) + var(--space-xl));
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    padding: 12px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.875rem;
    font-weight: 500;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    opacity: 0;
    transition: all var(--transition);
    z-index: 1000;
    pointer-events: none;
}

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

.toast.error {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 380px) {
    .chip {
        padding: 8px 14px;
        font-size: 0.75rem;
    }

    .text-input {
        padding: 12px 14px;
        font-size: 0.875rem;
    }

    .generate-btn {
        padding: 16px var(--space-lg);
    }
}

::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-card);
    border-radius: 2px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ========================================
   PRO BADGE & TAGS
   ======================================== */
.pro-badge {
    border: none;
    cursor: pointer;
    transition: all var(--transition);
}

.pro-badge:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 16px rgba(251, 113, 133, 0.3);
}

.pro-tag {
    font-size: 0.5625rem;
    font-weight: 700;
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-left: 4px;
}

.chip.pro-feature {
    position: relative;
}

.chip.pro-feature:not(.active) {
    border-color: rgba(244, 114, 182, 0.2);
}

/* ========================================
   UPGRADE HINT
   ======================================== */
.upgrade-hint {
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: var(--space-sm);
}

/* ========================================
   SOFT REMINDER
   ======================================== */
.soft-reminder {
    text-align: center;
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-top: var(--space-lg);
    padding: var(--space-md);
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.reminder-link {
    background: none;
    border: none;
    color: var(--accent-pink);
    font-size: 0.8125rem;
    font-weight: 500;
    font-family: var(--font-family);
    cursor: pointer;
    text-decoration: underline;
    transition: color var(--transition);
}

.reminder-link:hover {
    color: var(--accent-coral);
}

/* ========================================
   PAYWALL MODAL
   ======================================== */
.paywall-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-md);
    z-index: 2000;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.paywall-modal {
    width: 100%;
    max-width: 360px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    position: relative;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.paywall-close {
    position: absolute;
    top: var(--space-md);
    right: var(--space-md);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    color: var(--text-muted);
    font-size: 1.25rem;
    cursor: pointer;
    transition: all var(--transition);
}

.paywall-close:hover {
    background: var(--bg-input);
    color: var(--text-primary);
}

.paywall-content {
    text-align: center;
}

.paywall-icon {
    font-size: 3rem;
    margin-bottom: var(--space-md);
}

.paywall-title {
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
}

.paywall-subtitle {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    margin-bottom: var(--space-lg);
}

.paywall-features {
    list-style: none;
    text-align: left;
    margin-bottom: var(--space-lg);
}

.paywall-features li {
    font-size: 0.875rem;
    color: var(--text-secondary);
    padding: var(--space-sm) 0;
    border-bottom: 1px solid var(--border-color);
}

.paywall-features li:last-child {
    border-bottom: none;
}

.paywall-pricing {
    margin-bottom: var(--space-lg);
}

.paywall-price {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.paywall-period {
    font-size: 1rem;
    color: var(--text-muted);
}

/* Subscription Plan Options */
.plan-options {
    display: flex;
    gap: var(--space-sm);
    margin-bottom: var(--space-lg);
}

.plan-option {
    flex: 1;
    padding: var(--space-md);
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    position: relative;
}

.plan-option:hover {
    border-color: rgba(255, 255, 255, 0.2);
}

.plan-option.active {
    border-color: var(--accent-pink);
    background: rgba(244, 114, 182, 0.1);
}

.plan-name {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.plan-price {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-primary);
}

.plan-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    padding: 2px 8px;
    background: var(--gradient-accent);
    border-radius: var(--radius-full);
    font-size: 0.625rem;
    font-weight: 700;
    color: var(--bg-primary);
    text-transform: uppercase;
}

.paywall-cta {
    width: 100%;
    padding: 16px;
    background: var(--gradient-button);
    border: none;
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 600;
    font-family: var(--font-family);
    cursor: pointer;
    transition: all var(--transition);
}

.paywall-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(251, 113, 133, 0.3);
}

.paywall-cta:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.paywall-note {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: var(--space-md);
}

.restore-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-family: var(--font-family);
    cursor: pointer;
    margin-top: var(--space-sm);
    text-decoration: underline;
    transition: color var(--transition);
}

.restore-btn:hover {
    color: var(--text-secondary);
}

.paywall-secondary {
    width: 100%;
    padding: 12px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    font-family: var(--font-family);
    cursor: pointer;
    margin-top: var(--space-sm);
    transition: all var(--transition);
}

.paywall-secondary:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}

/* ========================================
   TEASER CONTENT (Blurred)
   ======================================== */
.teaser-content {
    position: relative;
}

.teaser-content::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60%;
    background: linear-gradient(to bottom, transparent, var(--bg-card));
    pointer-events: none;
}

.teaser-blur {
    filter: blur(4px);
    user-select: none;
    pointer-events: none;
}