/* ============================================
   Stealthy Good AI - Chat Interface Styles
   Inspired by Claude's warm, centered design

   Color Palette:
   - Primary Purple: #ce57ff
   - Dark Gray: #333745
   - Black: #000000
   - Light Background: #f8f8f8
   ============================================ */

:root {
    --purple-primary: #ce57ff;
    --purple-light: rgba(206, 87, 255, 0.1);
    --purple-medium: rgba(206, 87, 255, 0.15);
    --dark-gray: #333745;
    --black: #000000;
    --light-bg: #f8f8f8;
    --white: #ffffff;
    --text-primary: #1a1a1a;
    --text-secondary: #666666;
    --text-muted: #999999;
    --border-light: rgba(0, 0, 0, 0.08);
    --shadow-soft: 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-medium: 0 4px 20px rgba(0, 0, 0, 0.08);
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--light-bg);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    min-height: 100dvh;
}

/* App Layout */
.app {
    min-height: 100vh;
    min-height: 100dvh;
}

.hidden {
    display: none !important;
}

/* ============================================
   FIXED NAVIGATION (Logo & Side Panel Toggle)
   ============================================ */

.fixed-nav {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.fixed-logo-text {
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 1.5rem;
    font-weight: 400;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    transition: color var(--transition-fast);
}

.fixed-logo-text:hover {
    color: var(--purple-primary);
}

.side-panel-toggle {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: 1px solid var(--border-light);
    background-color: var(--white);
    color: var(--dark-gray);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-soft);
    position: relative;
    z-index: 101;
}

.side-panel-toggle:hover {
    background-color: var(--light-bg);
    border-color: var(--purple-primary);
    color: var(--purple-primary);
}

/* ============================================
   SIDE PANEL
   ============================================ */

.side-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100vh;
    height: 100dvh;
    background-color: var(--white);
    z-index: 200;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.1);
}

.side-panel.open {
    transform: translateX(0);
}

.side-panel-header {
    display: flex;
    justify-content: flex-end;
    padding: 16px;
    border-bottom: 1px solid var(--border-light);
}

.side-panel-close {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: none;
    background-color: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.side-panel-close:hover {
    background-color: var(--light-bg);
    color: var(--text-primary);
}

.side-panel-nav {
    flex: 1;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.side-panel-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border: none;
    background-color: transparent;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9375rem;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    border-radius: 10px;
    transition: all var(--transition-fast);
}

.side-panel-item:hover {
    background-color: var(--purple-light);
    color: var(--purple-primary);
}

.side-panel-item svg {
    flex-shrink: 0;
}

/* Easter egg item - subtle and at the bottom */
.side-panel-easter-egg {
    margin-top: auto;
    color: var(--text-muted);
    font-size: 0.75rem;
    padding: 10px 16px;
}

.side-panel-easter-egg:hover {
    color: var(--purple-primary);
}

.side-panel-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.3);
    z-index: 150;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.side-panel-overlay.visible {
    opacity: 1;
    visibility: visible;
}

/* ============================================
   WELCOME SCREEN - Claude-style centered layout
   ============================================ */

.welcome-screen {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background-color: var(--light-bg);
}

.welcome-content {
    width: 100%;
    max-width: 680px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
}

.welcome-header {
    display: flex;
    align-items: center;
    gap: 16px;
}

.welcome-logo {
    width: 48px;
    height: 48px;
    object-fit: contain;
}

.welcome-title {
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 2.5rem;
    font-weight: 400;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

/* Welcome Tagline */
.welcome-tagline {
    margin-top: 24px;
    font-size: 0.9rem;
    color: var(--text-muted);
    text-align: center;
    line-height: 1.5;
}

/* Welcome Input Container */
.welcome-input-container {
    width: 100%;
}

.welcome-input-wrapper {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    background-color: var(--white);
    border-radius: 24px;
    padding: 12px 12px 12px 24px;
    box-shadow: var(--shadow-medium);
    border: 1px solid var(--border-light);
    transition: box-shadow var(--transition-normal), border-color var(--transition-fast);
}

.welcome-input-wrapper:focus-within {
    box-shadow: 0 4px 24px rgba(206, 87, 255, 0.15);
    border-color: var(--purple-primary);
}

.welcome-input-wrapper textarea {
    flex: 1;
    border: none;
    background: transparent;
    font-family: inherit;
    font-size: 1rem;
    line-height: 1.5;
    resize: none;
    max-height: 120px;
    padding: 8px 0;
    color: var(--text-primary);
}

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

.welcome-input-wrapper textarea:focus {
    outline: none;
}

/* Send Button */
.send-button {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background-color: var(--purple-medium);
    color: var(--purple-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background-color var(--transition-fast), transform var(--transition-fast);
}

.send-button:hover {
    background-color: var(--purple-primary);
    color: var(--white);
    transform: scale(1.05);
}

.send-button:active {
    transform: scale(0.95);
}

.send-button:disabled {
    background-color: var(--border-light);
    color: var(--text-muted);
    cursor: not-allowed;
    transform: none;
}

/* ============================================
   CHAT SCREEN
   ============================================ */

.chat-screen {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    max-width: 800px;
    margin: 0 auto;
    background-color: var(--white);
}

@media (min-width: 840px) {
    .chat-screen {
        margin: 20px auto;
        height: calc(100vh - 40px);
        height: calc(100dvh - 40px);
        border-radius: 16px;
        overflow: hidden;
        box-shadow: var(--shadow-soft);
    }
}

/* Header */
.header {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-light);
    background-color: var(--white);
    flex-shrink: 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-logo {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.logo-text {
    font-size: 1rem;
    font-weight: 600;
    color: var(--dark-gray);
    letter-spacing: -0.02em;
}

/* Chat Container */
.chat-container {
    flex: 1;
    overflow-y: auto;
    padding: 32px 24px;
    display: flex;
    flex-direction: column;
    gap: 28px;
    scroll-behavior: smooth;
}

/* Messages */
.message {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    max-width: 85%;
    animation: messageIn 0.3s ease-out;
}

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

.message.assistant {
    align-self: flex-start;
}

.message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 500;
    overflow: hidden;
    margin-top: 4px;
}

.message.assistant .message-avatar {
    background: var(--purple-light);
    padding: 6px;
}

.message.assistant .message-avatar img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.message.user .message-avatar {
    background-color: var(--dark-gray);
    color: var(--white);
}

.message-content {
    padding: 14px 18px;
    border-radius: 20px;
    font-size: 0.9375rem;
    line-height: 1.55;
}

.message.assistant .message-content {
    background-color: var(--light-bg);
    color: var(--text-primary);
    border-bottom-left-radius: 6px;
}

.message.user .message-content {
    background-color: var(--dark-gray);
    color: var(--white);
    border-bottom-right-radius: 6px;
}

/* Message content formatting */
.message-content p {
    margin-bottom: 12px;
}

.message-content p:last-child {
    margin-bottom: 0;
}

.message-content strong {
    font-weight: 600;
}

.message-content a {
    color: var(--purple-primary);
    text-decoration: none;
}

.message-content a:hover {
    text-decoration: underline;
}

/* Clickable Options */
.message-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 16px;
}

.option-button {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 14px 18px;
    background-color: var(--white);
    border: 2px solid var(--border-light);
    border-radius: 12px;
    cursor: pointer;
    text-align: left;
    transition: all var(--transition-fast);
    width: 100%;
}

.option-button:hover {
    border-color: var(--purple-primary);
    background-color: var(--purple-light);
}

.option-button:active {
    transform: scale(0.98);
}

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

.option-button:hover .option-title {
    color: var(--purple-primary);
}

.option-description {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* Typing Indicator */
.typing-indicator {
    display: none;
    align-items: center;
    gap: 6px;
    padding: 14px 18px;
    background-color: var(--light-bg);
    border-radius: 20px;
    border-bottom-left-radius: 6px;
    width: fit-content;
    margin-left: 48px;
}

.typing-indicator.visible {
    display: flex;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background-color: var(--text-muted);
    border-radius: 50%;
    animation: typingBounce 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(1) {
    animation-delay: 0s;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingBounce {
    0%, 60%, 100% {
        transform: translateY(0);
        background-color: var(--text-muted);
    }
    30% {
        transform: translateY(-6px);
        background-color: var(--purple-primary);
    }
}

/* Input Area */
.input-area {
    padding: 16px 24px 60px;
    border-top: 1px solid var(--border-light);
    background-color: var(--white);
    flex-shrink: 0;
}

.input-wrapper {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    background-color: var(--light-bg);
    border-radius: 24px;
    padding: 8px 8px 8px 20px;
    border: 2px solid transparent;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.input-wrapper:focus-within {
    border-color: var(--purple-primary);
    box-shadow: 0 0 0 4px var(--purple-light);
}

.input-wrapper textarea {
    flex: 1;
    border: none;
    background: transparent;
    font-family: inherit;
    font-size: 0.9375rem;
    line-height: 1.5;
    resize: none;
    max-height: 120px;
    padding: 8px 0;
    color: var(--text-primary);
}

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

.input-wrapper textarea:focus {
    outline: none;
}

/* Scrollbar Styling */
.chat-container::-webkit-scrollbar {
    width: 6px;
}

.chat-container::-webkit-scrollbar-track {
    background: transparent;
}

.chat-container::-webkit-scrollbar-thumb {
    background-color: var(--border-light);
    border-radius: 3px;
}

.chat-container::-webkit-scrollbar-thumb:hover {
    background-color: var(--text-muted);
}

/* Mobile Adjustments */
@media (max-width: 600px) {
    .fixed-nav {
        top: 16px;
        left: 16px;
    }

    .fixed-logo-text {
        font-size: 1.25rem;
    }

    .side-panel-toggle {
        width: 40px;
        height: 40px;
    }

    .side-panel {
        width: 260px;
    }

    .welcome-title {
        font-size: 1.75rem;
    }

    .welcome-logo {
        width: 40px;
        height: 40px;
    }

    .welcome-content {
        gap: 32px;
    }

    /* Taller input box on mobile to show 2 lines */
    .welcome-input-wrapper textarea {
        min-height: 56px;
    }

    .header {
        padding: 16px 20px;
    }

    .chat-container {
        padding: 100px 16px 16px;
        gap: 16px;
    }

    .message {
        max-width: 90%;
    }

    .message-avatar {
        width: 32px;
        height: 32px;
        font-size: 0.75rem;
    }

    .message-content {
        padding: 12px 14px;
        font-size: 0.875rem;
    }

    .input-area {
        padding: 12px 16px 20px;
    }
}

/* Focus States for Accessibility */
.send-button:focus-visible {
    outline: 2px solid var(--purple-primary);
    outline-offset: 2px;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .chat-container {
        scroll-behavior: auto;
    }
}

/* ============================================
   TYPEWRITER CURSOR
   ============================================ */

.typing-cursor {
    display: inline;
    color: var(--purple-primary);
    font-weight: 400;
    animation: blink 0.8s infinite;
    margin-left: 1px;
}

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

/* ============================================
   MOTIVATIONAL POSTER
   ============================================ */

.motivational-poster {
    position: relative;
    width: 100%;
    max-width: 400px;
    aspect-ratio: 3 / 4;
    border-radius: 8px;
    overflow: hidden;
    margin: 16px 0;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    border: 8px solid #1a1a1a;
    background: #1a1a1a;
}

.poster-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.poster-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.poster-placeholder {
    background: linear-gradient(180deg,
        #1a0a2e 0%,
        #2d1b4e 30%,
        #4a2c6a 50%,
        #8b4d8b 70%,
        #d4738c 85%,
        #f5a66e 95%,
        #ffd700 100%
    );
}

.poster-gradient {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60%;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
}

.poster-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 24px 20px 32px;
    text-align: center;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.85));
}

.poster-word {
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 2.5rem;
    font-weight: bold;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 0.3em;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.8);
    margin-bottom: 12px;
}

.poster-tagline {
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 0.95rem;
    font-style: italic;
    color: #e0e0e0;
    line-height: 1.5;
    text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.8);
    max-width: 90%;
    margin: 0 auto;
}

/* Mobile adjustments for poster */
@media (max-width: 600px) {
    .motivational-poster {
        max-width: 100%;
        border-width: 6px;
    }

    .poster-word {
        font-size: 1.75rem;
        letter-spacing: 0.2em;
    }

    .poster-tagline {
        font-size: 0.85rem;
    }

    .poster-overlay {
        padding: 16px 16px 24px;
    }
}

/* ============================================
   SITE FOOTER
   ============================================ */

.site-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 16px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: var(--text-muted);
    background: linear-gradient(transparent, var(--white) 30%);
    pointer-events: none;
}

.site-footer span {
    pointer-events: auto;
}

.site-footer a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.site-footer a:hover {
    color: var(--purple-primary);
}

@media (max-width: 600px) {
    .site-footer {
        font-size: 0.65rem;
        padding: 12px 16px;
    }

    .input-area {
        padding-bottom: 50px;
    }
}
