/* BrandSelf — Official Stylesheet */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,700;1,400&family=DM+Sans:wght@300;400;500&display=swap');

:root {
    --bg: #0e0e0e;
    --surface: #161616;
    --surface2: #1f1f1f;
    --border: #2a2a2a;
    --gold: #c9a84c;
    --gold-light: #e8c97a;
    --text: #f0ece4;
    --text-muted: #7a7570;
    --text-dim: #4a4540;
    --radius: 16px;
}

* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
    -webkit-tap-highlight-color: transparent;
}

html, body {
    height: 100%;
    height: 100dvh;
    width: 100%;
    overflow: hidden;
    background: var(--bg);
    color: var(--text);
    font-family: 'DM Sans', sans-serif;
    font-weight: 300;
    overscroll-behavior-y: none; /* Stops accidental pull-to-refresh on mobile */
}

body { 
    display: flex; 
    flex-direction: column; 
}

/* Background Ambient Glow */
body::before {
    content: '';
    position: fixed;
    top: -50%; left: -20%;
    width: 60%; height: 80%;
    background: radial-gradient(ellipse, rgba(201, 168, 76, 0.04) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

/* UTILITY */
.hidden { display: none !important; }

/* INTRO SCREEN */
#intro-screen {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 48px 32px;
    background: var(--bg);
    z-index: 2000;
    overflow-y: auto;
}

.intro-icon { 
    font-family: 'Playfair Display', serif; 
    font-size: 64px; 
    color: var(--gold); 
    margin-bottom: 20px; 
    animation: gentleFloat 4s ease-in-out infinite; 
}

@keyframes gentleFloat { 
    0%, 100% { transform: translateY(0) } 
    50% { transform: translateY(-6px) } 
}

/* PRIVACY LINK - FIXED CLICKABLE AREA */
.privacy-link {
    font-size: 12px;
    color: var(--text-dim);
    text-decoration: underline;
    cursor: pointer;
    margin-top: 24px;
    position: relative;
    z-index: 2100;
    display: inline-block;
    padding: 10px; /* Larger hit area for mobile */
    transition: color 0.2s;
}

.privacy-link:hover {
    color: var(--gold-light);
}

/* HEADER */
header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
    background: var(--bg);
    position: relative;
    z-index: 100;
    flex-shrink: 0;
}

.logo { font-family: 'Playfair Display', serif; font-size: 18px; color: var(--gold); }
.logo span { color: var(--text-muted); font-style: italic; font-size: 11px; margin-left: 8px; }

/* CHAT AREA */
.chat-wrapper {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    position: relative;
    z-index: 1;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

.messages {
    max-width: 680px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding-bottom: 40px;
}

/* MESSAGES & BUBBLES */
.msg { 
    display: flex; 
    gap: 14px; 
    animation: fadeUp 0.4s ease forwards; 
}

@keyframes fadeUp { 
    from { opacity: 0; transform: translateY(12px) } 
    to { opacity: 1; transform: translateY(0) } 
}

.msg.user { flex-direction: row-reverse; }

.avatar { 
    width: 34px; height: 34px; 
    border-radius: 50%; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    flex-shrink: 0; 
}

.avatar.ai { background: var(--gold); color: #0e0e0e; font-family: 'Playfair Display', serif; }
.avatar.user { background: var(--surface2); color: var(--text-muted); border: 1px solid var(--border); font-size: 10px; }

.bubble { 
    max-width: calc(100% - 50px); 
    padding: 16px 20px; 
    border-radius: 16px; 
    line-height: 1.6; 
    font-size: 15px; 
}

.msg.ai .bubble { background: var(--surface); border: 1px solid var(--border); }
.msg.user .bubble { background: #1e1a14; border: 1px solid rgba(201, 168, 76, 0.2); }

/* INPUT SECTION */
.input-section {
    border-top: 1px solid var(--border);
    padding: 16px 24px;
    background: var(--bg);
    flex-shrink: 0;
    z-index: 10;
}

.input-wrap { max-width: 680px; margin: 0 auto; display: flex; gap: 12px; align-items: flex-end; }

textarea { 
    flex: 1; 
    background: var(--surface); 
    border: 1px solid var(--border); 
    border-radius: 12px; 
    color: var(--text); 
    padding: 14px 18px; 
    resize: none; 
    min-height: 52px; 
    max-height: 160px; 
    outline: none;
    font-size: 16px; /* Prevents iOS auto-zoom */
}

/* PROGRESS BAR */
.progress-container { display: flex; align-items: center; }
.progress-bar { width: 80px; height: 2px; background: var(--border); border-radius: 2px; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--gold), var(--gold-light)); width: 0%; transition: width 0.5s ease; }

/* BUTTONS */
.lang-options { display: flex; gap: 10px; justify-content: center; margin-bottom: 32px; flex-wrap: wrap; }
.lang-btn { padding: 10px 20px; border-radius: 100px; border: 1px solid var(--border); background: transparent; color: var(--text-muted); cursor: pointer; transition: 0.2s; }
.lang-btn.selected { border-color: var(--gold); background: rgba(201,168,76,0.1); color: var(--gold-light); }

.start-btn { 
    background: linear-gradient(135deg, var(--gold), #8a5c1a); 
    color: #0e0e0e; 
    border: none; 
    padding: 16px 40px; 
    border-radius: 100px; 
    font-weight: 500; 
    cursor: pointer; 
    transition: 0.3s;
    opacity: 0.3; 
    pointer-events: none;
}

.start-btn.ready { 
    opacity: 1; 
    pointer-events: all; 
}

.send-btn { 
    width: 52px; height: 52px; 
    border-radius: 12px; 
    background: linear-gradient(135deg, var(--gold), #8a5c1a); 
    border: none; 
    cursor: pointer; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
}

.send-btn:disabled { opacity: 0.3; cursor: not-allowed; }

/* GOLD REPORT CARD */
.report-card { 
    background: var(--surface); 
    border: 1px solid rgba(201,168,76,0.25); 
    border-radius: var(--radius); 
    padding: 24px; 
    margin-top: 8px; 
    width: 100%; 
}

.report-title { 
    font-family: 'Playfair Display', serif; 
    font-size: 20px; 
    color: var(--gold-light); 
    margin-bottom: 15px; 
    border-bottom: 1px solid var(--border); 
    padding-bottom: 10px; 
}

.report-section { margin-bottom: 15px; }
.report-label { 
    font-size: 10px; 
    text-transform: uppercase; 
    letter-spacing: 0.1em; 
    color: var(--gold); 
    margin-bottom: 4px; 
}

.keyword-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.niche-pill {
    background: linear-gradient(135deg, #d4af37, #f9e29c);
    color: #1a1a1a;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
}

/* PRIVACY MODAL */
#privacy-modal {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
    padding: 20px;
}

.modal-content {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    max-width: 500px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    padding: 32px;
}

.modal-content h2 { font-family: 'Playfair Display', serif; margin-bottom: 16px; color: var(--gold); }

.close-modal {
    background: var(--gold);
    color: #000;
    border: none;
    padding: 12px 24px;
    border-radius: 100px;
    font-weight: 500;
    cursor: pointer;
    width: 100%;
    margin-top: 20px;
}

/* TYPING INDICATOR */
.typing-indicator { display: flex; gap: 4px; padding: 8px; }
.typing-dot { 
    width: 6px; height: 6px; 
    background: var(--gold); 
    border-radius: 50%; 
    animation: pulse 1.5s infinite; 
}
@keyframes pulse { 0%, 100% { opacity: 0.3 } 50% { opacity: 1 } }

/* PDF PRINT FIXES */
@media print {
    .report-card {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
        background: #161616 !important;
        border: 1px solid #c9a84c !important;
    }
}