:root {
    --primary-color: #4285F4;
    --secondary-color: #34A853;
    --background-color: #f9f9f9;
    --card-background: #ffffff;
    --text-color: #333333;
    --border-color: #e0e0e0;
}

body {
    font-family: 'Roboto', sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    max-width: 900px;
    margin: 0 auto;
    padding: 30px;
    line-height: 1.6;
}

.container {
    background-color: var(--card-background);
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    padding: 25px;
    margin-bottom: 20px;
}

h1 {
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 30px;
    font-weight: 500;
}

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #555;
}

textarea, input[type="text"] {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-family: 'Roboto', sans-serif;
    font-size: 14px;
    transition: border-color 0.3s;
    box-sizing: border-box;
}

textarea {
    height: 120px;
    resize: vertical;
}

textarea:focus, input[type="text"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(66, 133, 244, 0.2);
}

.button-group {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

button {
    padding: 10px 20px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.3s, transform 0.1s;
    flex: 1;
}

button:hover {
    background-color: #3367D6;
}

button:active {
    transform: scale(0.98);
}

#clear {
    background-color: #757575;
}

#clear:hover {
    background-color: #616161;
}

.response-container {
    background-color: var(--card-background);
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    padding: 20px;
}

#response {
    white-space: pre-wrap;
    min-height: 200px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 15px;
    background-color: #fafafa;
    font-size: 15px;
    line-height: 1.6;
}

#metadata {
    margin-top: 15px;
    font-size: 12px;
    color: #757575;
    padding: 8px;
    background-color: #f5f5f5;
    border-radius: 4px;
}

.reference-section, .questions-section {
    margin-top: 20px;
    border-top: 1px solid var(--border-color);
    padding-top: 15px;
}

.reference-section h3, .questions-section h3 {
    color: var(--primary-color);
    font-size: 16px;
    margin-bottom: 10px;
}

.reference-item {
    margin-bottom: 15px;
    padding: 10px;
    background-color: #f9f9f9;
    border-radius: 4px;
    border-left: 3px solid var(--primary-color);
}

.reference-title {
    font-weight: 500;
    color: var(--primary-color);
    margin-bottom: 5px;
    font-size: 14px;
}

.reference-snippet {
    font-size: 12px;
    color: #555;
    margin-bottom: 5px;
}

.reference-url {
    font-size: 11px;
    color: #888;
    word-break: break-all;
}

.reference-url a {
    color: var(--primary-color);
    text-decoration: none;
}

.reference-url a:hover {
    text-decoration: underline;
}

.follow-up-question {
    display: block;
    margin-bottom: 8px;
    padding: 8px 12px;
    background-color: #f0f7ff;
    border-radius: 4px;
    color: var(--primary-color);
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    font-size: 13px;
    border-left: 3px solid var(--primary-color);
}

.follow-up-question:hover {
    background-color: #e0f0ff;
    transform: translateX(2px);
}

.loading-container {
    display: none;
    text-align: center;
    margin: 20px 0;
}

.loading-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid rgba(66, 133, 244, 0.3);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.typing-indicator {
    display: inline-block;
    position: relative;
    min-width: 30px;
}

.typing-indicator span {
    display: inline-block;
    width: 8px;
    height: 8px;
    background-color: var(--primary-color);
    border-radius: 50%;
    margin: 0 2px;
    opacity: 0.6;
    animation: typing 1.4s infinite both;
}

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

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

@keyframes typing {
    0% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
    100% { transform: translateY(0); }
}

.metadata-section {
    margin-top: 20px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.metadata-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.metadata-title {
    font-weight: 500;
    color: #555;
    font-size: 14px;
}

.metadata-badge {
    display: inline-block;
    padding: 3px 8px;
    background-color: var(--primary-color);
    color: white;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
}


/* Financial Dashboard Styles */
#financial-dashboard {
    display: none;
    background-color: #ffffff;
    color: #333333;
    border-radius: 12px;
    padding: 25px;
    margin-top: 25px;
    font-family: 'Roboto', sans-serif;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 15px;
}

.dashboard-header h2 {
    margin: 0;
    font-size: 28px;
    font-weight: 500;
    color: var(--primary-color);
}

.dashboard-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 400;
    color: #666;
}

.dashboard-tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.tab {
    padding: 12px 24px;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    font-weight: 500;
    color: #666;
    transition: all 0.2s ease;
}

.tab:hover {
    background-color: #f5f5f5;
}

.tab.active {
    border-bottom: 3px solid var(--primary-color);
    color: var(--primary-color);
}

.financial-metrics {
    margin-bottom: 30px;
    padding: 15px;
    background-color: #f9f9f9;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.metric-label {
    font-size: 16px;
    color: #666;
    margin-bottom: 5px;
    font-weight: 500;
}

.metric-value {
    font-size: 36px;
    font-weight: 500;
    margin-bottom: 15px;
    color: #333;
}

.growth-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
}

.growth-metric {
    background-color: #f5f5f5;
    padding: 12px 18px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    flex: 1;
    min-width: 180px;
}

.positive {
    color: #4CAF50;
    font-weight: 500;
}

.negative {
    color: #F44336;
    font-weight: 500;
}

.chart-container {
    height: 300px;
    margin: 30px 0;
    position: relative;
    background-color: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.chart-y-axis {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 50px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    color: #666;
    font-size: 12px;
    padding: 10px 0;
}

.chart-bars {
    margin-left: 50px;
    height: 100%;
    display: flex;
    align-items: flex-end;
    gap: 20px;
}

.chart-bar {
    flex: 1;
    background-color: var(--primary-color);
    position: relative;
    border-radius: 4px 4px 0 0;
    min-width: 30px;
    transition: height 0.5s ease;
}

.chart-bar-label {
    position: absolute;
    bottom: -25px;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 12px;
    color: #666;
    font-weight: 500;
}

.chart-bar-value {
    position: absolute;
    top: -25px;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 12px;
    color: #333;
    font-weight: 500;
    background-color: rgba(255, 255, 255, 0.8);
    padding: 2px 4px;
    border-radius: 4px;
}

.collapsible-sections {
    margin-top: 30px;
}

.section {
    margin-bottom: 15px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.section-header {
    padding: 15px 20px;
    background-color: #f5f5f5;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 500;
    color: #333;
    transition: background-color 0.2s ease;
}

.section-header:hover {
    background-color: #e9e9e9;
}

.section-header:after {
    content: '▼';
    font-size: 12px;
    transition: transform 0.3s;
    color: var(--primary-color);
}

.section-header.collapsed:after {
    transform: rotate(-90deg);
}

.section-content {
    padding: 20px;
    display: none;
    background-color: #fff;
}

.financial-table {
    width: 100%;
    border-collapse: collapse;
}

.financial-table th, .financial-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.financial-table th {
    color: #666;
    font-weight: 500;
    background-color: #f9f9f9;
}

.financial-table tr:hover {
    background-color: #f5f5f5;
}

/* Folding functionality for big model responses */
.model-response-container {
    position: relative;
    margin-top: 15px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
}

.model-response-header {
    padding: 12px 15px;
    background-color: #f5f5f5;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 500;
    color: #333;
}

.model-response-header:after {
    content: '▼';
    font-size: 12px;
    transition: transform 0.3s;
    color: var(--primary-color);
}

.model-response-header.collapsed:after {
    transform: rotate(-90deg);
}

.model-response-content {
    padding: 15px;
    max-height: 500px;
    overflow-y: auto;
    background-color: #fff;
    transition: max-height 0.3s ease;
}

.model-response-content.collapsed {
    max-height: 0;
    padding: 0 15px;
    overflow: hidden;
}
