/* Modern CEO Assistant Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #1976D2;
    --secondary-color: #64B5F6;
    --accent-color: #4CAF50;
    --background-color: #fafafa;
    --surface-color: #ffffff;
    --text-primary: #2c3e50;
    --text-secondary: #546e7a;
    --border-color: #e1e8ed;
    --shadow-light: 0 2px 8px rgba(0,0,0,0.1);
    --shadow-medium: 0 4px 12px rgba(0,0,0,0.15);
    --border-radius: 12px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, var(--background-color) 0%, #f0f7ff 100%);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.main-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 2rem 0;
    text-align: center;
    box-shadow: var(--shadow-medium);
}

.main-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.main-header p {
    font-size: 1.1rem;
    opacity: 0.9;
    font-weight: 400;
}

/* Main Container */
.main-container {
    padding: 2rem 0 120px 0; /* Bottom padding for fixed chat input */
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Chat Section */
.chat-section {
    background: var(--background-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    max-width: 900px;
    margin: 0 auto;
}

.chat-messages {
    min-height: 500px;
    max-height: 700px;
    overflow-y: auto;
    padding: 2rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.message {
    animation: slideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    width: 100%;
}

.user-message {
    display: flex;
    justify-content: center;
    margin-bottom: 1rem;
}

.assistant-message {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
}

.user-message .message-content {
    background: #f0f0f0;
    color: #2c3e50;
    border-radius: 20px;
    padding: 0.75rem 1.5rem;
    max-width: 80%;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    font-size: 0.95rem;
    text-align: center;
    border: 1px solid #e1e8ed;
}

.assistant-message .message-content {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 2rem;
    max-width: 100%;
    box-shadow: var(--shadow-light);
    line-height: 1.7;
    font-size: 0.95rem;
}

.example-queries {
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(25, 118, 210, 0.05);
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}

.example-queries h4 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
}

.example-queries ul {
    list-style: none;
}

.example-queries li {
    padding: 0.25rem 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
}

.example-queries li:hover {
    color: var(--primary-color);
    transform: translateX(4px);
}

.example-queries li::before {
    content: "💡 ";
    margin-right: 0.5rem;
}

/* Chat Input */
.chat-input-container {
    background: var(--surface-color);
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
}

.input-wrapper {
    display: flex;
    gap: 0.5rem;
    max-width: 900px;
    margin: 0 auto;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 25px;
    padding: 0.5rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    align-items: flex-end;
}

.attachment-button {
    padding: 0.75rem;
    background: transparent;
    color: var(--text-secondary);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    width: 44px;
    height: 44px;
    flex-shrink: 0;
}

.attachment-button:hover {
    background: rgba(25, 118, 210, 0.1);
    color: var(--primary-color);
    transform: scale(1.05);
}

#user-input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: none;
    background: transparent;
    font-size: 0.95rem;
    outline: none;
    color: var(--text-primary);
    resize: none;
    min-height: 24px;
    max-height: 120px;
    font-family: inherit;
}

#user-input::placeholder {
    color: #94a3b8;
    font-style: italic;
}

.send-button {
    padding: 0.75rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    width: 44px;
    height: 44px;
    flex-shrink: 0;
}

.send-button:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(25, 118, 210, 0.3);
}

.send-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Inline File Upload (within chat messages) */
.inline-file-upload {
    margin: 1rem 0;
    padding: 1.5rem;
    border: 2px dashed var(--border-color);
    border-radius: var(--border-radius);
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    background: rgba(25, 118, 210, 0.02);
}

.inline-file-upload:hover,
.inline-file-upload.dragover {
    border-color: var(--primary-color);
    background: rgba(25, 118, 210, 0.05);
    transform: translateY(-2px);
}

.inline-file-upload svg {
    color: var(--primary-color);
    margin-bottom: 0.75rem;
}

.inline-file-upload p {
    margin: 0.25rem 0;
    color: var(--text-primary);
}

.inline-file-upload .file-types {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* File Preview in Chat */
.file-preview {
    margin: 1rem 0;
    padding: 1rem;
    background: rgba(76, 175, 80, 0.05);
    border: 1px solid rgba(76, 175, 80, 0.2);
    border-radius: var(--border-radius);
}

.file-preview h4 {
    margin: 0 0 0.5rem 0;
    color: var(--accent-color);
    font-size: 0.9rem;
}

.file-preview-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    background: rgba(76, 175, 80, 0.1);
    border-radius: 8px;
    margin: 0.5rem 0;
}

.file-preview-item svg {
    color: var(--accent-color);
    flex-shrink: 0;
}

.file-info {
    flex: 1;
}

.file-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.file-size {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Inline Visualizations */
.inline-visualization {
    margin: 1.5rem 0;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-light);
}

.visualization-header {
    padding: 1rem 1.5rem;
    background: rgba(25, 118, 210, 0.05);
    border-bottom: 1px solid var(--border-color);
}

.visualization-title {
    margin: 0 0 0.25rem 0;
    color: var(--primary-color);
    font-size: 1.1rem;
    font-weight: 600;
}

.visualization-description {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.visualization-content {
    padding: 1rem;
}

/* Loading states */
.thinking-inline {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1rem 0;
    padding: 1rem;
    background: rgba(25, 118, 210, 0.05);
    border-radius: var(--border-radius);
    color: var(--primary-color);
}

.thinking-inline .loading-dots {
    display: flex;
    gap: 0.25rem;
}

.thinking-inline .dot {
    width: 6px;
    height: 6px;
    background: var(--primary-color);
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
}

.file-drop-zone {
    background: var(--surface-color);
    border: 2px dashed var(--border-color);
    border-radius: var(--border-radius);
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.file-drop-zone:hover,
.file-drop-zone.dragover {
    border-color: var(--primary-color);
    background: rgba(25, 118, 210, 0.02);
    transform: translateY(-2px);
    box-shadow: var(--shadow-light);
}

.drop-zone-content svg {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.drop-zone-content p:first-of-type {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.file-types {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

#file-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

/* Visualizations Section */
.visualizations-section {
    background: var(--surface-color);
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--shadow-light);
    animation: slideIn 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.visualizations-section h2 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    font-weight: 600;
}

.charts-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
    min-height: 200px;
}

.chart-wrapper {
    background: var(--surface-color);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-light);
    border: 1px solid var(--border-color);
    animation: chartAppear 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Loading Animation - Above Chat Input */
.loading-animation {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem 0;
    animation: fadeIn 0.3s ease-in;
    background: rgba(250, 250, 250, 0.95);
    backdrop-filter: blur(5px);
    border-top: 1px solid var(--border-color);
    position: fixed;
    bottom: 100px; /* Above the fixed chat input container */
    left: 0;
    right: 0;
    z-index: 11; /* Higher z-index to appear above content but below input */
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
}

.thinking-container {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-color);
    padding: 1rem 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-light);
    max-width: 300px;
}

.thinking-text {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-primary);
}

.loading-dots {
    display: flex;
    gap: 0.25rem;
}

.dot {
    width: 8px;
    height: 8px;
    background: var(--primary-color);
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
}

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

/* Animations */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes chartAppear {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.1); opacity: 1; }
}

@keyframes bounce {
    0%, 80%, 100% {
        transform: scale(0);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .main-header h1 {
        font-size: 2rem;
    }
    
    .main-container {
        padding: 2rem 0 140px 0; /* More padding for mobile */
    }
    
    .charts-container {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .chart-wrapper {
        padding: 1rem;
    }
    
    .assistant-message .message-content,
    .user-message .message-content {
        max-width: 95%;
    }
    
    .chat-input-container {
        padding: 1rem 15px;
    }
    
    .loading-animation {
        bottom: 90px; /* Adjust for mobile chat input height */
    }
}

/* Success/Error Messages */
.success-message {
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    color: #2e7d32;
    padding: 1rem;
    border-radius: var(--border-radius);
    border-left: 4px solid #4caf50;
    margin: 1rem 0;
    animation: slideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.error-message {
    background: linear-gradient(135deg, #ffebee 0%, #ffcdd2 100%);
    color: #c62828;
    padding: 1rem;
    border-radius: var(--border-radius);
    border-left: 4px solid #f44336;
    margin: 1rem 0;
    animation: slideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}