@import url('conversation.css');

:root {
    --primary-color: #10b981;
    --primary-dark: #059669;
    --primary-light: #34d399;
    --secondary-color: #f8fafc;
    --text-color: #1e293b;
    --text-light: #64748b;
    --border-color: #e2e8f0;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --radius: 12px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

    /* Mobile first variables */
    --mobile-padding: 1rem;
    --tablet-padding: 1.5rem;
    --desktop-padding: 2rem;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 14px; /* Base font size for mobile */
}

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-text-size-adjust: 100%; /* Prevent font scaling in landscape */
}

/* Mobile First Styles */
.modern-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: var(--mobile-padding);
}

/* Hero Section - Mobile First */
.hero-section {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--mobile-padding);
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    text-align: center;
}

.hero-content {
    width: 100%;
    max-width: 100%;
}

.hero-content h1 {
    font-size: 2rem; /* Smaller on mobile */
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.highlight {
    background: linear-gradient(45deg, #fbbf24, #f59e0b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: block; /* Stack on mobile */
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    margin-bottom: 2rem;
}

/* Features Grid - Mobile Stack */
.features-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin: 2rem 0;
}

.feature-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 1.5rem;
    border-radius: var(--radius);
    border: 1px solid rgba(255, 255, 255, 0.2);
    text-align: center;
    transition: var(--transition);
}

.feature-card:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.15);
}

.feature-card i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: var(--primary-light);
}

.feature-card h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.feature-card p {
    font-size: 0.9rem;
}

/* CTA Section */
.cta-section {
    margin: 1.5rem 0;
}

.cta-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: white;
    color: var(--primary-dark);
    padding: 1rem 1.5rem;
    border-radius: var(--radius);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
    width: 100%; /* Full width on mobile */
    justify-content: center;
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

/* Auth Styles - Mobile First */
.auth-modern {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
    padding: var(--mobile-padding);
}

.auth-container {
    width: 100%;
    max-width: 100%;
}

.auth-card {
    background: white;
    padding: 2rem 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin: 0 auto;
}

.auth-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.auth-header i {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.auth-header h1 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

/* Form Styles - Touch Friendly */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.9rem;
    color: #1a202c; /* Dark color for better visibility */
}

.input-with-icon {
    position: relative;
}

.input-with-icon i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
}

.input-with-icon input {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 1rem;
    transition: var(--transition);
    min-height: 54px; /* Touch friendly height */
}

.input-with-icon input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

/* Buttons - Touch Friendly */
.modern-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 1.5rem;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    min-height: 54px; /* Minimum touch target size */
    justify-content: center;
}

.modern-btn.primary {
    background: var(--primary-color);
    color: white;
}

.modern-btn.primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.modern-btn.full-width {
    width: 100%;
}

/* Chat Modern Styles - Mobile Optimized */
.chat-modern {
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: white;
}

.chat-header {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    padding: 1rem var(--mobile-padding);
    flex-shrink: 0; /* Prevent header from shrinking */
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.header-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 0; /* Allow text truncation */
}

.header-info i {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.header-info h1 {
    font-size: 1.2rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.location {
    font-size: 0.8rem;
    opacity: 0.9;
    display: none; /* Hide on mobile to save space */
}

.header-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.weather-btn, .logout-btn {
    padding: 0.5rem 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.1);
    color: white;
    text-decoration: none;
    transition: var(--transition);
    font-size: 0.8rem;
    min-height: 40px;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.weather-btn:hover, .logout-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Chat Main - Mobile Optimized */
.chat-main {
    flex: 1;
    overflow: hidden;
    background: var(--secondary-color);
    position: relative;
}

.chat-messages {
    height: 100%;
    overflow-y: auto;
    padding: 1rem var(--mobile-padding);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
}

/* Messages - Mobile Optimized */
.message {
    display: flex;
    gap: 0.75rem;
    max-width: 95%; /* More width on mobile */
}

.message.assistant {
    align-self: flex-start;
}

.message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message-avatar {
    width: 36px; /* Smaller on mobile */
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.message.assistant .message-avatar {
    background: var(--primary-color);
    color: white;
}

.message.user .message-avatar {
    background: #3b82f6;
    color: white;
}

.message-content {
    background: white;
    padding: 1rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    flex: 1;
    max-width: calc(100% - 50px); /* Account for avatar */
}

.message.user .message-content {
    background: #3b82f6;
    color: white;
}

/* Welcome Message - Mobile Optimized */
.welcome-message .message-content {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.quick-actions {
    display: flex;
    gap: 0.5rem;
    margin: 1rem 0;
    flex-wrap: wrap;
}

.quick-action {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: var(--transition);
    min-height: 40px;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex: 1;
    min-width: 0;
    justify-content: center;
}

.quick-action:hover {
    background: rgba(255, 255, 255, 0.3);
}

.message-footer {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.3);
    font-size: 0.75rem;
    opacity: 0.8;
}

/* Chat Footer - Mobile Optimized */
.chat-footer {
    padding: 1rem var(--mobile-padding);
    background: white;
    border-top: 1px solid var(--border-color);
    flex-shrink: 0; /* Prevent footer from shrinking */
}

.chat-input-form {
    display: flex;
    gap: 0.5rem;
}

.input-container {
    flex: 1;
    position: relative;
}

.input-container input {
    width: 100%;
    padding: 1rem 3.5rem 1rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 1rem;
    transition: var(--transition);
    min-height: 54px; /* Touch friendly */
}

.input-container input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.send-btn {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: var(--primary-color);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.send-btn:hover {
    background: var(--primary-dark);
}

/* Onboarding Styles - Mobile First */
.onboarding-modern {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
    padding: var(--mobile-padding);
}

.onboarding-container {
    width: 100%;
    max-width: 100%;
}

.onboarding-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.onboarding-header i {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.onboarding-header h1 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.location-suggestions {
    margin: 1.5rem 0;
}

.suggestion-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.9rem;
    color: #1a202c; /* Dark color for better visibility */
}

.suggestion-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.suggestion-tag {
    background: var(--secondary-color);
    border: 2px solid var(--border-color);
    padding: 0.75rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.9rem;
    min-height: 44px; /* Touch friendly */
    display: flex;
    align-items: center;
}

.suggestion-tag:hover, .suggestion-tag.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.onboarding-benefits {
    margin-top: 2rem;
    padding: 1.5rem;
    background: var(--secondary-color);
    border-radius: var(--radius);
}

.onboarding-benefits h3 {
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.1rem;
}

.onboarding-benefits ul {
    list-style: none;
}

.onboarding-benefits li {
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

/* Footer */
.modern-footer {
    background: var(--text-color);
    color: white;
    text-align: center;
    padding: 1.5rem var(--mobile-padding);
    font-size: 0.8rem;
}

/* Tablet Styles (768px and up) */
@media (min-width: 768px) {
    html {
        font-size: 16px; /* Larger base font size */
    }

    .modern-container {
        padding: var(--tablet-padding);
    }

    .hero-content h1 {
        font-size: 2.5rem;
    }

    .highlight {
        display: inline; /* Back to inline on tablet */
    }

    .features-grid {
        flex-direction: row;
        gap: 1.5rem;
    }

    .feature-card {
        flex: 1;
        padding: 2rem;
    }

    .cta-button {
        width: auto;
        padding: 1rem 2rem;
    }

    .auth-container {
        max-width: 400px;
    }

    .auth-card {
        padding: 3rem 2rem;
    }

    .chat-header {
        padding: 1rem var(--tablet-padding);
    }

    .header-info h1 {
        font-size: 1.5rem;
    }

    .location {
        display: inline; /* Show location on tablet */
    }

    .chat-messages {
        padding: 1.5rem var(--tablet-padding);
    }

    .message {
        max-width: 80%;
        gap: 1rem;
    }

    .message-avatar {
        width: 40px;
        height: 40px;
    }

    .message-content {
        padding: 1.5rem;
    }

    .chat-footer {
        padding: 1rem var(--tablet-padding);
    }

    .onboarding-container {
        max-width: 500px;
    }
}

/* Desktop Styles (1024px and up) */
@media (min-width: 1024px) {
    .modern-container {
        padding: var(--desktop-padding);
    }

    .hero-content h1 {
        font-size: 3.5rem;
    }

    .features-grid {
        gap: 2rem;
    }

    .feature-card:hover {
        transform: translateY(-5px);
    }

    .chat-header {
        padding: 1rem var(--desktop-padding);
    }

    .chat-messages {
        padding: 2rem var(--desktop-padding);
    }

    .weather-btn, .logout-btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }

    .quick-action {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
        flex: none;
    }
}

/* Large Desktop Styles (1440px and up) */
@media (min-width: 1440px) {
    .hero-content, .auth-container, .onboarding-container {
        max-width: 1200px;
    }
}

/* High DPI Screens */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .feature-card {
        backdrop-filter: blur(20px); /* Better blur on retina */
    }
}

/* Print Styles */
@media print {
    .chat-header, .chat-footer, .header-actions {
        display: none;
    }

    .chat-modern {
        height: auto;
    }

    body {
        background: white;
    }
}

/* Reduced motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    :root {
        --text-color: #f1f5f9;
        --text-light: #94a3b8;
        --secondary-color: #1e293b;
        --border-color: #334155;
    }

    body {
        background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    }

    .auth-card, .message-content:not(.user) {
        background: #334155;
        color: var(--text-color);
    }
}

/* Added New lines for making the model remember and be more intelligent

/* Memory and context awareness styles */
.memory-badge {
    font-size: 0.7em;
    margin-left: 5px;
    opacity: 0.7;
}

.context-info {
    margin-top: 1rem;
    padding: 0.5rem;
    background: rgba(16, 185, 129, 0.1);
    border-radius: 4px;
    font-size: 0.8rem;
    color: #059669;
    border-left: 3px solid #10b981;
}

.context-loading {
    font-size: 0.8rem;
    opacity: 0.7;
    font-style: italic;
}

.memory-controls {
    margin: 1rem 0;
    padding: 1rem;
    background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
    border-radius: var(--radius);
    border: 2px solid #10b981;
}

.controls-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.memory-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #059669;
    font-weight: 500;
}

.memory-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: white;
    border: 1px solid #10b981;
    border-radius: var(--radius);
    color: #059669;
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.8rem;
}

.memory-btn:hover {
    background: #10b981;
    color: white;
    transform: translateY(-1px);
}

/* System message for conversation switching */
.message.system {
    align-self: center;
    max-width: 80%;
    text-align: center;
}

.message.system .message-content {
    background: #e3f2fd;
    border: 1px solid #2196f3;
    color: #1565c0;
    padding: 1rem;
    border-radius: var(--radius);
    text-align: center;
}

.message.system .message-content h4 {
    margin: 0 0 0.5rem 0;
    color: #1565c0;
}

.message.system .message-content p {
    margin: 0 0 0.5rem 0;
}

.message.system .message-content small {
    opacity: 0.8;
}

/* Mobile adjustments for memory controls */
@media (max-width: 768px) {
    .controls-content {
        flex-direction: column;
        align-items: stretch;
    }

    .memory-status {
        justify-content: center;
        text-align: center;
    }

    .memory-controls {
        margin: 0.5rem 0;
        padding: 0.75rem;
    }
}

/* ============================================================================
   COPYRIGHT FOOTER
   ============================================================================ */

.viridia-copyright {
    background-color: #f8f9fa;
    padding: 1rem;
    text-align: center;
    border-top: 1px solid #e9ecef;
    margin-top: auto;
}

.viridia-copyright p {
    margin: 0;
    font-size: 0.85rem;
    color: #6c757d;
}