/* Global Variables */
:root {
    /* Light Theme Colors */
    --bg-primary: #fafaf9;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f5f5f4;
    --text-primary: #1c1917;
    --text-secondary: #57534e;
    --text-tertiary: #78716c;
    --border-color: #e7e5e4;
    --accent-color: #000000;
    --accent-hover: #333333;
    --feed-color: #8B4513;
    --feed-hover: #654321;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    
    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-serif: 'Crimson Text', Georgia, serif;
    
    /* Spacing */
    --header-height: 60px;
    --input-area-height: 120px;
}

/* Dark Theme */
[data-theme="dark"] {
    --bg-primary: #0a0a0a;
    --bg-secondary: #171717;
    --bg-tertiary: #262626;
    --text-primary: #fafaf9;
    --text-secondary: #d6d3d1;
    --text-tertiary: #a8a29e;
    --border-color: #404040;
    --accent-color: #000000;
    --accent-hover: #333333;
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

body {
    font-family: var(--font-sans);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* App Container */
.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-width: 100%;
    margin: 0 auto;
}

/* Header */
.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    z-index: 100;
    backdrop-filter: blur(10px);
    background-color: rgba(var(--bg-secondary-rgb, 255, 255, 255), 0.9);
}

[data-theme="dark"] .app-header {
    background-color: rgba(23, 23, 23, 0.9);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo i {
    font-size: 1.5rem;
    color: #000000;
}

.logo h1 {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.theme-toggle {
    width: 40px;
    height: 40px;
    border: none;
    background-color: var(--bg-tertiary);
    color: var(--text-secondary);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.theme-toggle:hover {
    background-color: var(--border-color);
    color: var(--text-primary);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-top: var(--header-height);
    margin-bottom: var(--input-area-height);
    overflow-y: auto;
    background-color: var(--bg-primary);
}

/* Welcome Screen */
.welcome-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - var(--header-height) - var(--input-area-height));
    padding: 2rem;
    animation: fadeIn 0.5s ease;
}

.welcome-content {
    text-align: center;
    max-width: 600px;
}

.welcome-icon {
    font-size: 4rem;
    color: #000000;
    margin-bottom: 1.5rem;
    opacity: 0.8;
}

.welcome-content h2 {
    font-family: var(--font-serif);
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.welcome-text {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    line-height: 1.8;
}

.suggestion-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
}

.chip {
    padding: 0.75rem 1.25rem;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 2rem;
    font-size: 0.875rem;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.chip:hover {
    background-color: var(--bg-tertiary);
    border-color: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.chip i {
    font-size: 1rem;
    color: #000000;
}

/* Chat Container */
.chat-container {
    display: none;
    flex-direction: column;
    height: calc(100vh - var(--header-height) - var(--input-area-height));
    max-width: 900px;
    margin: 0 auto;
    width: 100%;
}

.messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 2rem 1rem;
    scroll-behavior: smooth;
}

/* Messages */
.message {
    margin-bottom: 1.5rem;
    animation: messageSlide 0.3s ease;
}

.message-content {
    display: inline-block;
    max-width: 85%;
    word-wrap: break-word;
}

.message.user .message-content {
    background-color: var(--accent-color);
    color: white;
    padding: 0.875rem 1.25rem;
    border-radius: 1.5rem 1.5rem 0.25rem 1.5rem;
    margin-left: auto;
    display: block;
}

.message.assistant .message-content {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    padding: 1rem 1.25rem;
    border-radius: 0.25rem 1.5rem 1.5rem 1.5rem;
    border: 1px solid var(--border-color);
}

.message.assistant .poem {
    font-family: var(--font-serif);
    font-size: 1.25rem;
    line-height: 1.8;
    white-space: pre-wrap;
    margin: 1rem 0;
    padding: 1rem;
    background-color: var(--bg-tertiary);
    border-radius: 0.5rem;
    font-style: italic;
}

.message-actions {
    margin-top: 0.5rem;
    display: flex;
    gap: 0.5rem;
}

.message-action {
    padding: 0.25rem 0.75rem;
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    font-size: 0.75rem;
    color: var(--text-tertiary);
    cursor: pointer;
    transition: all 0.3s ease;
}

.message-action:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
}

/* Typing Indicator */
.typing-indicator {
    display: inline-flex;
    align-items: center;
    padding: 0.875rem 1.25rem;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 0.25rem 1.5rem 1.5rem 1.5rem;
}

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

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

/* Input Area */
.input-area {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 1rem;
    z-index: 100;
}

.input-container {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    align-items: flex-end;
    gap: 0.75rem;
}

.message-input {
    flex: 1;
    padding: 0.875rem 1.25rem;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 1.5rem;
    font-size: 1rem;
    font-family: var(--font-sans);
    color: var(--text-primary);
    resize: none;
    outline: none;
    transition: all 0.3s ease;
    max-height: 120px;
    line-height: 1.5;
}

.message-input:focus {
    border-color: var(--accent-color);
    background-color: var(--bg-primary);
}

.send-button {
    width: 48px;
    height: 48px;
    border: none;
    background-color: var(--accent-color);
    color: white;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.send-button:hover:not(:disabled) {
    background-color: var(--accent-hover);
    transform: scale(1.05);
}

.send-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.input-info {
    max-width: 900px;
    margin: 0.5rem auto 0;
    display: flex;
    justify-content: flex-end;
}

.char-count {
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.loading-spinner {
    background-color: var(--bg-secondary);
    padding: 2rem 3rem;
    border-radius: 1rem;
    box-shadow: var(--shadow-lg);
    text-align: center;
}

.loading-spinner i {
    font-size: 3rem;
    color: #000000;
    margin-bottom: 1rem;
    display: block;
}

.loading-spinner p {
    font-size: 1.125rem;
    color: var(--text-secondary);
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: calc(var(--header-height) + 1rem);
    right: 1rem;
    z-index: 1000;
}

.toast {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    box-shadow: var(--shadow-lg);
    margin-bottom: 0.75rem;
    animation: slideIn 0.3s ease;
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.toast.success {
    border-color: #000000;
}

.toast.error {
    border-color: #000000;
}

.toast i {
    font-size: 1.25rem;
}

.toast.success i {
    color: #000000;
}

.toast.error i {
    color: #000000;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

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

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .welcome-content h2 {
        font-size: 2rem;
    }
    
    .welcome-text {
        font-size: 1rem;
    }
    
    .suggestion-chips {
        flex-direction: column;
        align-items: stretch;
    }
    
    .chip {
        justify-content: center;
    }
    
    .message-content {
        max-width: 90%;
    }
    
    .input-container {
        padding: 0;
    }
}

@media (max-width: 480px) {
    .logo h1 {
        font-size: 1.25rem;
    }
    
    .welcome-icon {
        font-size: 3rem;
    }
    
    .message-input {
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

/* ABSOLUTE FORCE ALL ICONS BLACK - HIGHEST PRIORITY */
i, i.fas, i.far, i.fab, .fa, .fas, .far, .fab,
i[class*="fa-"], .icon, [class*="icon-"],
i[style*="color"], .fas[style*="color"], .far[style*="color"],
*[class*="fa-"], *[class*="icon-"] {
    color: #000000 !important;
    fill: #000000 !important;
}

/* Override any specific color classes and inline styles */
.text-red, .text-danger, .color-red,
.btn i, .button i, .nav i, .header i,
i[style], .fas[style], .far[style], .fab[style] {
    color: #000000 !important;
    fill: #000000 !important;
}

/* Override SVG icons too */
svg, svg * {
    fill: #000000 !important;
    color: #000000 !important;
}
/* Feed Button */
.btn-feed {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--feed-color);
    color: white;
    text-decoration: none;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-feed:hover {
    background: var(--feed-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
    color: white;
    text-decoration: none;
}

.btn-feed i {
    font-size: 16px;
}

.btn-feed-accent {
    background: #000000 !important;
}

.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--accent-color);
    color: white;
    text-decoration: none;
    border-radius: 25px;
    font-weight: 500;
    transition: all 0.2s ease;
    margin-bottom: 20px;
}

.btn-back:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    color: white;
    text-decoration: none;
}


/* Welcome screen modes styling */
.welcome-modes {
    font-size: 14px;
    line-height: 1.8;
    color: var(--text-secondary);
    margin: 20px 0;
    padding: 15px;
    background: var(--bg-tertiary);
    border-radius: 10px;
    font-style: italic;
}

.welcome-expansion {
    font-size: 15px;
    color: var(--text-primary);
    font-weight: 500;
    margin-top: 15px;
}


/* Update suggestion chips for grid layout */
.suggestion-chips {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
    margin-top: 20px;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.chip {
    justify-content: center;
    padding: 10px 15px;
}

@media (max-width: 768px) {
    .suggestion-chips {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 8px;
    }
    
    .chip {
        font-size: 12px;
        padding: 8px 10px;
    }
}

/* FINAL OVERRIDE - FORCE ALL ICONS BLACK - MAXIMUM PRIORITY */
html i, html i.fas, html i.far, html i.fab, html .fa, html .fas, html .far, html .fab,
body i, body i.fas, body i.far, body i.fab, body .fa, body .fas, body .far, body .fab,
div i, div i.fas, div i.far, div i.fab, div .fa, div .fas, div .far, div .fab,
* i, * i.fas, * i.far, * i.fab, * .fa, * .fas, * .far, * .fab,
i[class*="fa-"], *[class*="fa-"], .icon, *[class*="icon-"],
i[style], i[style*="color"], .fas[style], .fas[style*="color"] {
    color: #000000 !important;
    fill: #000000 !important;
}

/* Force override any accent color usage for icons */
i, .fas, .far, .fab {
    color: #000000 !important;
    fill: #000000 !important;
}

/* Global Mobile Responsive Styles */
@media (max-width: 768px) {
    .app-header {
        height: 50px !important;
    }
    
    :root {
        --header-height: 50px;
    }
    
    .header-content {
        padding: 0 1rem !important;
        height: 50px !important;
    }
    
    .logo h1 {
        font-size: 1.25rem !important;
    }
    
    .header-actions {
        gap: 0.25rem !important;
    }
    
    .btn-feed {
        padding: 0.5rem !important;
        min-width: auto !important;
        width: 40px !important;
        height: 40px !important;
        justify-content: center !important;
    }
    
    .btn-feed span {
        display: none !important;
    }
    
    .language-toggle {
        padding: 0.375rem 0.5rem !important;
        gap: 0.25rem !important;
    }
    
    .language-toggle span {
        display: none !important;
    }
    
    .theme-toggle {
        width: 36px !important;
        height: 36px !important;
    }
}

@media (max-width: 480px) {
    .app-header {
        height: 45px !important;
    }
    
    :root {
        --header-height: 45px;
    }
    
    .header-content {
        padding: 0 0.75rem !important;
        height: 45px !important;
    }
    
    .logo h1 {
        font-size: 1.1rem !important;
    }
    
    .header-actions {
        gap: 0.125rem !important;
    }
    
    .btn-feed {
        width: 36px !important;
        height: 36px !important;
        padding: 0.375rem !important;
    }
    
    .language-toggle {
        padding: 0.25rem 0.375rem !important;
    }
    
    .theme-toggle {
        width: 32px !important;
        height: 32px !important;
    }
}

