﻿* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --accent-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --success-gradient: linear-gradient(135deg, #81FBB8 0%, #28C76F 100%);
    --warning-gradient: linear-gradient(135deg, #FEB692 0%, #EA5455 100%);
    --bg-primary: #0f0f23;
    --bg-secondary: #1a1a2e;
    --bg-tertiary: #16213e;
    --bg-glass: rgba(255, 255, 255, 0.1);
    --bg-glass-hover: rgba(255, 255, 255, 0.15);
    --text-primary: #ffffff;
    --text-secondary: #b8b8d1;
    --text-muted: #8b8ba7;
    --text-accent: #64ffda;
    --border-color: rgba(255, 255, 255, 0.2);
    --border-hover: rgba(255, 255, 255, 0.3);
    --shadow-glass: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
    --shadow-elevated: 0 20px 60px rgba(0, 0, 0, 0.3);
    --shadow-floating: 0 10px 30px rgba(0, 0, 0, 0.2);
    --border-radius: 16px;
    --border-radius-lg: 24px;
    --border-radius-sm: 12px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Animated background */
.bg-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.1;
}

    .bg-animation::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: radial-gradient(circle at 20% 20%, #667eea 0%, transparent 50%), radial-gradient(circle at 80% 80%, #764ba2 0%, transparent 50%), radial-gradient(circle at 40% 40%, #f093fb 0%, transparent 50%);
        animation: float 20s ease-in-out infinite;
    }

@keyframes float {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }

    33% {
        transform: translateY(-20px) rotate(120deg);
    }

    66% {
        transform: translateY(20px) rotate(240deg);
    }
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-glass);
    position: relative;
    overflow: hidden;
}

    .header::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 4px;
        background: var(--primary-gradient);
        animation: shimmer 2s ease-in-out infinite;
    }

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

.header-content {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.logo {
    width: 60px;
    height: 60px;
    background: var(--primary-gradient);
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    box-shadow: var(--shadow-floating);
    flex-shrink: 0;
}

.header-text h1 {
    font-size: 2.5rem;
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.header-text p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* Chat Interface */
.chat-interface {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 2rem;
    flex: 1;
}

.chat-main {
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-glass);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-messages {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
    max-height: 60vh;
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}

    .chat-messages::-webkit-scrollbar {
        width: 6px;
    }

    .chat-messages::-webkit-scrollbar-track {
        background: transparent;
    }

    .chat-messages::-webkit-scrollbar-thumb {
        background: var(--border-color);
        border-radius: 10px;
    }

.message {
    display: flex;
    margin-bottom: 1.5rem;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message-content {
    max-width: 80%;
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius);
    position: relative;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.message.user {
    justify-content: flex-end;
}

    .message.user .message-content {
        background: var(--primary-gradient);
        color: white;
        border-bottom-right-radius: 6px;
    }

.message.bot {
    justify-content: flex-start;
}

    .message.bot .message-content {
        background: var(--bg-secondary);
        border: 1px solid var(--border-color);
        border-bottom-left-radius: 6px;
    }

.message-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
    transition: var(--transition);
    flex-wrap: wrap;
}

.action-btn {
    padding: 0.3rem 0.6rem;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.8rem;
    white-space: nowrap;
}

    .action-btn:hover {
        background: var(--bg-glass-hover);
        color: var(--text-primary);
        transform: translateY(-2px);
    }

/* Chat Input */
.chat-input-container {
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-glass);
}

.chat-input-wrapper {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
}

.input-group {
    flex: 1;
    position: relative;
}

.chat-input {
    width: 100%;
    min-height: 50px;
    max-height: 150px;
    padding: 1rem 3rem 1rem 1rem;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    color: var(--text-primary);
    font-size: 1rem;
    resize: none;
    outline: none;
    transition: var(--transition);
    font-family: inherit;
}

    .chat-input:focus {
        border-color: var(--text-accent);
        box-shadow: 0 0 0 3px rgba(100, 255, 218, 0.1);
    }

.input-actions {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    gap: 0.5rem;
}

.input-action {
    width: 32px;
    height: 32px;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-secondary);
}

    .input-action:hover {
        background: var(--primary-gradient);
        color: white;
        transform: scale(1.1);
    }

.send-btn {
    width: 50px;
    height: 50px;
    background: var(--primary-gradient);
    border: none;
    border-radius: var(--border-radius);
    color: white;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: var(--shadow-floating);
}

    .send-btn:hover {
        transform: translateY(-2px);
        box-shadow: var(--shadow-elevated);
    }

    .send-btn:disabled {
        opacity: 0.5;
        cursor: not-allowed;
        transform: none;
    }

/* Sidebar */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.sidebar-section {
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-glass);
}

    .sidebar-section h3 {
        font-size: 1.3rem;
        margin-bottom: 1rem;
        color: var(--text-accent);
    }

.disclaimer {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
}

    .disclaimer strong {
        color: var(--text-primary);
    }

/* FAQ Section */
.faq-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.faq-item {
    padding: 0.8rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-secondary);
    font-size: 0.9rem;
}

    .faq-item:hover {
        background: var(--bg-glass-hover);
        border-color: var(--border-hover);
        color: var(--text-primary);
        transform: translateX(5px);
    }

/* Loading Animation */
.loading-dots {
    display: flex;
    gap: 0.3rem;
    align-items: center;
    padding: 1rem;
}

.loading-dot {
    width: 8px;
    height: 8px;
    background: var(--text-accent);
    border-radius: 50%;
    animation: pulse 1.5s ease-in-out infinite;
}

    .loading-dot:nth-child(2) {
        animation-delay: 0.2s;
    }

    .loading-dot:nth-child(3) {
        animation-delay: 0.4s;
    }

@keyframes pulse {
    0%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }

    50% {
        transform: scale(1.2);
        opacity: 1;
    }
}

/* Disclaimer Box */
.disclaimer-box {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1rem;
    background: var(--bg-glass);
}

    .disclaimer-box[open] summary i.fa-info-circle {
        color: #dc3545;
    }

    .disclaimer-box summary {
        cursor: pointer;
        list-style: none;
        outline: none;
        display: flex;
        align-items: center;
        gap: 0.5rem;
        font-weight: 600;
        padding: 0.5rem 0;
    }

        .disclaimer-box summary::-webkit-details-marker {
            display: none;
        }

.disclaimer-text {
    margin-top: 0.5rem;
    font-size: 0.875rem;
    line-height: 1.4;
}

/* Utility Classes */
.hidden {
    display: none;
}

.fade-in {
    animation: fadeIn 0.3s ease-out;
}

.slide-up {
    animation: slideUp 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Success/Error Messages */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius);
    color: white;
    font-weight: 500;
    z-index: 1000;
    transform: translateX(100%);
    transition: var(--transition);
}

    .toast.show {
        transform: translateX(0);
    }

    .toast.success {
        background: var(--success-gradient);
    }

    .toast.error {
        background: var(--warning-gradient);
    }

/* ===== IMPROVED RESPONSIVE DESIGN ===== */

/* Large tablets and small laptops */
@media (max-width: 1200px) {
    .chat-interface {
        grid-template-columns: 1fr 350px;
        gap: 1.5rem;
    }

    .container {
        padding: 15px;
    }
}

/* Tablets */
@media (max-width: 1024px) {
    .chat-interface {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .sidebar {
        order: 1;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
    }

    .header {
        padding: 1.5rem;
        margin-bottom: 1.5rem;
    }

    .header-content {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .header-text h1 {
        font-size: 2.2rem;
    }

    .chat-messages {
        max-height: 55vh;
        padding: 1.2rem;
    }
}

/* Mobile landscape and small tablets */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    .header {
        padding: 1.2rem;
        margin-bottom: 1rem;
        border-radius: var(--border-radius);
    }

    .header-text h1 {
        font-size: 1.8rem;
    }

    .header-text p {
        font-size: 1rem;
    }

    .logo {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }

    .chat-interface {
        gap: 1rem;
    }

    .sidebar {
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }

    .sidebar-section {
        padding: 1rem;
    }

        .sidebar-section h3 {
            font-size: 1.1rem;
        }

    .chat-messages {
        max-height: 50vh;
        padding: 1rem;
    }

    .message-content {
        max-width: 90%;
        padding: 0.8rem 1rem;
    }

    .message-actions {
        flex-wrap: wrap;
        gap: 0.3rem;
    }

    .action-btn {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
    }

    .chat-input-container {
        padding: 1rem;
    }

    .chat-input {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 0.8rem 2.5rem 0.8rem 0.8rem;
    }

    .input-actions {
        right: 0.8rem;
        gap: 0.3rem;
    }

    .input-action {
        width: 28px;
        height: 28px;
        font-size: 0.8rem;
    }

    .send-btn {
        width: 45px;
        height: 45px;
        font-size: 1rem;
    }

    .faq-item {
        padding: 0.6rem;
        font-size: 0.85rem;
    }
}

/* Mobile portrait */
@media (max-width: 480px) {
    .container {
        padding: 8px;
    }

    .header {
        padding: 1rem;
        border-radius: var(--border-radius-sm);
    }

    .header-text h1 {
        font-size: 1.5rem;
    }

    .header-text p {
        font-size: 0.9rem;
    }

    .logo {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .chat-main {
        border-radius: var(--border-radius);
    }

    .sidebar-section {
        padding: 0.8rem;
        border-radius: var(--border-radius);
    }

    .chat-messages {
        max-height: 45vh;
        padding: 0.8rem;
    }

    .message {
        margin-bottom: 1rem;
    }

    .message-content {
        max-width: 95%;
        padding: 0.6rem 0.8rem;
        font-size: 0.9rem;
    }

    .chat-input-wrapper {
        gap: 0.5rem;
    }

    .chat-input {
        min-height: 44px; /* Better touch target */
        font-size: 16px;
        padding: 0.7rem 2.2rem 0.7rem 0.7rem;
    }

    .send-btn {
        width: 40px;
        height: 40px;
        font-size: 0.9rem;
    }

    .input-actions {
        right: 0.7rem;
    }

    .input-action {
        width: 24px;
        height: 24px;
        font-size: 0.7rem;
    }

    .disclaimer-text {
        font-size: 0.8rem;
    }

    .faq-item {
        padding: 0.5rem;
        font-size: 0.8rem;
    }

    /* Make action buttons always visible on mobile */
    .message-actions {
        opacity: 1;
        margin-top: 0.3rem;
    }

    .action-btn {
        font-size: 0.7rem;
        padding: 0.2rem 0.4rem;
    }
}

/* Very small screens */
@media (max-width: 360px) {
    .container {
        padding: 5px;
    }

    .header {
        padding: 0.8rem;
    }

    .header-text h1 {
        font-size: 1.3rem;
    }

    .sidebar-section {
        padding: 0.6rem;
    }

    .chat-messages {
        padding: 0.6rem;
    }

    .chat-input-container {
        padding: 0.8rem;
    }

    .message-content {
        padding: 0.5rem 0.7rem;
        font-size: 0.85rem;
    }
}

/* Landscape orientation adjustments */
@media (max-height: 500px) and (orientation: landscape) {
    .header {
        padding: 0.8rem;
        margin-bottom: 0.5rem;
    }

    .header-text h1 {
        font-size: 1.5rem;
    }

    .chat-messages {
        max-height: 35vh;
    }

    .sidebar {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
    }

    .sidebar-section {
        padding: 0.8rem;
    }
}

/* Print styles */
@media print {
    .bg-animation,
    .input-actions,
    .send-btn,
    .chat-input-container,
    .sidebar {
        display: none;
    }

    .container {
        max-width: 100%;
        padding: 0;
    }

    .chat-main {
        box-shadow: none;
        border: 1px solid #ddd;
    }

    .message-content {
        max-width: 100%;
        break-inside: avoid;
    }
}
