/* ===== INFINITIZEM ZAVESTI — STYLES ===== */

:root {
    --bg-primary: #0a0a0a;
    --bg-secondary: #111111;
    --bg-card: #1a1a1a;
    --gold: #c9a84c;
    --gold-dim: rgba(201, 168, 76, 0.3);
    --gold-glow: rgba(201, 168, 76, 0.08);
    --text-primary: #e8e4dc;
    --text-secondary: #8a8578;
    --text-dim: #5a5650;
    --border: #2a2520;
    --font-serif: 'Cormorant Garamond', Georgia, serif;
    --font-sans: 'Inter', -apple-system, sans-serif;
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    overflow-x: hidden;
    overflow-y: auto;
    line-height: 1.7;
}

/* ===== AMBIENT BACKGROUND ===== */
.ambient-bg {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    pointer-events: none;
    z-index: 0;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(201, 168, 76, 0.03) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(201, 168, 76, 0.02) 0%, transparent 40%),
        radial-gradient(ellipse at 50% 80%, rgba(100, 80, 40, 0.03) 0%, transparent 50%);
}

/* ===== CONTAINER ===== */
.container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 720px;
    padding: 3rem 2rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2.5rem;
}

/* ===== HEADER ===== */
.header {
    text-align: center;
}

.infinity-symbol {
    font-size: 3rem;
    color: var(--gold);
    margin-bottom: 0.5rem;
    text-shadow: 0 0 30px var(--gold-dim);
}

.infinity-symbol.small {
    font-size: 2rem;
    margin-bottom: 0.3rem;
}

h1 {
    font-family: var(--font-serif);
    font-size: 2.5rem;
    font-weight: 400;
    letter-spacing: 0.02em;
    color: var(--text-primary);
    margin-bottom: 0.35rem;
}

.author {
    font-family: var(--font-serif);
    font-size: 1.05rem;
    font-weight: 400;
    letter-spacing: 0.04em;
    color: var(--gold);
    margin-bottom: 0.65rem;
}

.subtitle {
    font-size: 0.95rem;
    color: var(--text-secondary);
    font-weight: 300;
}

.formula-hero {
    margin-top: 0.85rem;
    font-family: var(--font-serif);
    font-size: 0.9rem;
    letter-spacing: 0.06em;
    color: var(--text-dim);
}

/* ===== INPUT AREA ===== */
.input-area {
    width: 100%;
}

.search-box {
    display: flex;
    align-items: center;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0.25rem;
    transition: border-color 0.3s;
}

.search-box:focus-within {
    border-color: var(--gold-dim);
    box-shadow: 0 0 20px var(--gold-glow);
}

.search-box input {
    flex: 1;
    background: none;
    border: none;
    padding: 1rem 1.25rem;
    font-size: 1rem;
    color: var(--text-primary);
    font-family: var(--font-sans);
    outline: none;
}

.search-box input::placeholder {
    color: var(--text-dim);
}

.search-box button {
    background: var(--gold);
    border: none;
    border-radius: 8px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--bg-primary);
    transition: transform 0.2s, opacity 0.2s;
}

.search-box button:hover {
    transform: scale(1.05);
    opacity: 0.9;
}

/* ===== QUESTIONS COUNTER ===== */
.questions-counter {
    text-align: center;
    margin-top: 0.75rem;
    font-size: 0.8rem;
    color: var(--text-dim);
}

.questions-counter .highlight {
    color: var(--gold);
}

/* ===== SUGGESTIONS ===== */
.suggestions {
    margin-top: 2rem;
}

.suggestions-label {
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 1rem;
}

.suggestion-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.suggestion-btn {
    background: linear-gradient(135deg, var(--bg-secondary), #151515);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-family: var(--font-sans);
    cursor: pointer;
    text-align: left;
    transition: all 0.3s;
}

.suggestion-btn:hover {
    border-color: var(--gold-dim);
    color: var(--text-primary);
    background: linear-gradient(135deg, #1a1815, #151210);
}

/* ===== ANSWER AREA ===== */
.answer-area {
    width: 100%;
    animation: fadeIn 0.5s ease;
}

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

.question-display {
    font-family: var(--font-serif);
    font-size: 1.4rem;
    font-style: italic;
    color: var(--gold);
    text-align: center;
    margin-bottom: 1.5rem;
}

.answer-divider {
    width: 60px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--gold-dim), transparent);
    margin: 0 auto 2rem;
}

.answer-text {
    font-size: 1.05rem;
    line-height: 1.9;
    color: var(--text-primary);
    white-space: pre-wrap;
}

.answer-text.typing::after {
    content: '';
    display: inline-block;
    width: 2px;
    height: 1.2em;
    background: var(--gold);
    margin-left: 2px;
    animation: blink 0.8s infinite;
    vertical-align: text-bottom;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

.answer-formula {
    margin-top: 2rem;
    text-align: center;
    animation: fadeIn 0.8s ease;
}

.answer-formula img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    background: var(--bg-secondary);
    padding: 1rem;
}

.answer-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    justify-content: center;
    margin: 2.5rem auto 0;
}

.answer-actions[hidden] {
    display: none;
}

.share-btn,
.back-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    background: none;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.7rem 1.25rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-family: var(--font-sans);
    cursor: pointer;
    transition: all 0.3s;
}

.share-btn {
    border-color: var(--gold-dim);
    color: var(--gold);
    background: var(--gold-glow);
}

.share-btn:hover:not(:disabled) {
    border-color: var(--gold);
    background: rgba(201, 168, 76, 0.14);
}

.share-btn:disabled {
    opacity: 0.55;
    cursor: wait;
}

.back-btn:hover {
    border-color: var(--gold-dim);
    color: var(--gold);
}

/* ===== LOADING ===== */
.loading {
    text-align: center;
    padding: 2rem;
}

.loading p {
    color: var(--text-dim);
    font-size: 0.9rem;
    margin-top: 1rem;
    font-style: italic;
}

.loading-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
}

.loading-dots span {
    width: 8px;
    height: 8px;
    background: var(--gold);
    border-radius: 50%;
    animation: pulse 1.4s infinite;
}

.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes pulse {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
    40% { transform: scale(1); opacity: 1; }
}

/* ===== PAYWALL MODAL ===== */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    animation: fadeIn 0.3s ease;
}

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    max-width: 480px;
    width: 100%;
    padding: 2.5rem;
    position: relative;
}

.modal-compact {
    max-width: 420px;
}

.email-note {
    margin-top: 0.85rem;
    font-size: 0.75rem;
    color: var(--text-dim);
    line-height: 1.45;
}

.legal-check {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
    margin-top: 1rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.45;
    cursor: pointer;
    text-align: left;
}

.legal-check input {
    margin-top: 0.2rem;
    flex-shrink: 0;
    accent-color: var(--gold);
}

.legal-check a {
    color: var(--gold);
    text-decoration: none;
}

.legal-check a:hover {
    text-decoration: underline;
}

.legal-paywall-note {
    margin-top: 1.25rem;
    font-size: 0.75rem;
    color: var(--text-dim);
    text-align: center;
    line-height: 1.5;
}

.legal-paywall-note a {
    color: var(--gold);
    text-decoration: none;
}

.legal-paywall-note a:hover {
    text-decoration: underline;
}

.modal-share {
    max-width: 420px;
}

.share-preview-wrap {
    margin: 0 auto 1.25rem;
    width: min(320px, 100%);
    aspect-ratio: 1 / 1;
    border: 1px solid var(--border);
    border-radius: 4px;
    overflow: hidden;
    background: #050505;
}

.share-preview-wrap img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.share-modal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    justify-content: center;
}

.share-link-box {
    margin: 0 0 1.1rem;
    text-align: left;
}

.share-link-box[hidden] {
    display: none;
}

.share-link-box label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-dim);
    margin-bottom: 0.35rem;
}

.share-link-row {
    display: flex;
    gap: 0.45rem;
}

.share-link-row input {
    flex: 1;
    min-width: 0;
    padding: 0.55rem 0.65rem;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: #111;
    color: var(--text-primary);
    font-size: 0.78rem;
}

.share-open-link {
    display: inline-block;
    margin-top: 0.55rem;
    font-size: 0.8rem;
    color: var(--gold);
    text-decoration: none;
}

.share-open-link:hover {
    text-decoration: underline;
}

.share-hint {
    margin: 0.85rem 0 0;
    font-size: 0.75rem;
    color: var(--text-dim);
    text-align: center;
    line-height: 1.45;
}

.modal-header {
    text-align: center;
    margin-bottom: 2rem;
}

.modal-header h2 {
    font-family: var(--font-serif);
    font-size: 1.6rem;
    font-weight: 400;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.modal-header p {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 1.8rem;
    cursor: pointer;
    transition: color 0.2s;
}

.modal-close:hover {
    color: var(--text-primary);
}

/* Code input */
.code-section {
    margin-bottom: 1.5rem;
}

.code-section label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.code-input-row {
    display: flex;
    gap: 0.5rem;
}

.code-input-row input {
    flex: 1;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    font-family: monospace;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    outline: none;
}

.code-input-row input:focus {
    border-color: var(--gold-dim);
}

.code-input-row button {
    background: var(--gold);
    border: none;
    border-radius: 8px;
    padding: 0.75rem 1.25rem;
    color: var(--bg-primary);
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    transition: opacity 0.2s;
}

.code-input-row button:hover {
    opacity: 0.9;
}

.code-hint {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin: 0.5rem 0 0;
    line-height: 1.4;
    opacity: 0.85;
}

.code-message {
    font-size: 0.8rem;
    margin-top: 0.5rem;
    min-height: 1.2em;
}

.code-message.success { color: #4caf50; }
.code-message.error { color: #f44336; }

.code-forget {
    display: block;
    margin-top: 0.35rem;
    padding: 0;
    border: none;
    background: none;
    color: var(--text-secondary);
    font-size: 0.72rem;
    text-decoration: underline;
    cursor: pointer;
    opacity: 0.75;
}

.code-forget:hover {
    color: var(--gold-dim);
    opacity: 1;
}

/* Divider */
.divider-text {
    text-align: center;
    margin: 1.5rem 0;
    position: relative;
}

.divider-text::before {
    content: '';
    position: absolute;
    left: 0; right: 0;
    top: 50%;
    height: 1px;
    background: var(--border);
}

.divider-text span {
    background: var(--bg-card);
    padding: 0 1rem;
    position: relative;
    color: var(--text-dim);
    font-size: 0.8rem;
}

/* Packages */
.packages {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.package-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, var(--bg-secondary), #151515);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1rem 1.25rem;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.3s;
    position: relative;
}

.package-btn:hover {
    border-color: var(--gold-dim);
    transform: translateY(-1px);
}

.package-btn.popular {
    border-color: var(--gold-dim);
    background: linear-gradient(135deg, #1a1815, #151210);
}

.package-badge {
    position: absolute;
    top: -8px;
    right: 12px;
    background: var(--gold);
    color: var(--bg-primary);
    font-size: 0.65rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.package-name {
    font-size: 0.95rem;
}

.package-price {
    font-weight: 500;
    color: var(--gold);
    font-size: 1.1rem;
}

.package-note {
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-dim);
    margin-top: 1rem;
}

/* ===== FOOTER ===== */
.footer {
    text-align: center;
    padding-top: 1rem;
}

.footer p {
    font-size: 0.8rem;
    color: var(--text-dim);
}

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

.footer-author {
    margin-top: 0.75rem;
    color: #c9a84c;
}

.footer-author a {
    color: #c9a84c !important;
    text-decoration: none;
    font-size: 0.9rem;
    font-family: var(--font-serif);
    transition: opacity 0.3s;
}

.footer-author a:hover,
.footer-author a:visited {
    color: #c9a84c !important;
    opacity: 0.85;
    text-decoration: underline;
}

.formula-footer {
    margin-top: 0.5rem;
    font-family: var(--font-serif);
    font-size: 0.9rem;
    color: var(--text-dim);
    opacity: 0.5;
}

.legal-links {
    margin-top: 1rem;
    font-size: 0.75rem;
    color: var(--text-dim);
    opacity: 0.6;
}

.legal-links a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s;
}

.legal-links a:hover {
    color: var(--gold);
    text-decoration: underline;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 600px) {
    .container {
        padding: 2rem 1.25rem;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    .suggestion-grid {
        grid-template-columns: 1fr;
    }
    
    .modal {
        padding: 1.5rem;
    }
    
    .question-display {
        font-size: 1.2rem;
    }
}
