/* Custom styles for Inter font and general aesthetics */
body {
    font-family: "Inter", sans-serif;
    background: linear-gradient(to right bottom, #6a11cb, #2575fc); /* Gradient background */
    min-height: 100vh;
    display: flex; /* Make body a flex container */
    flex-direction: column; /* Stack children vertically */
    padding: 0; /* Remove padding from body as nav/footer will manage it */
    margin: 0;
}

/* New wrapper to center content and ensure nav doesn't overlap */
.main-content-wrapper {
    flex-grow: 1; /* Allows this wrapper to take up available space, pushing footer down */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem; /* Add padding here instead of body */
    padding-top: 5rem; /* Space for fixed nav bar */
}

/* Nav Bar Styles */
nav {
    background-color: #1a202c; /* Dark grey */
    color: #fff;
    padding: 1rem;
    position: fixed; /* Fix to top */
    top: 0;
    width: 100%;
    z-index: 100; /* Ensure it's on top of other content */
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

nav a {
    color: #fff;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    transition: background-color 0.2s;
}

nav a:hover {
    background-color: #2d3748; /* Slightly lighter grey on hover */
}

/* Footer Styles */
footer {
    background-color: #1a202c; /* Dark grey */
    color: #a0aec0; /* Lighter grey for text */
    padding: 1.5rem;
    text-align: center;
    font-size: 0.9rem;
    width: 100%;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.2);
    margin-top: auto; /* Pushes footer to the bottom if content is short */
}

/* Add to your existing CSS */
/* IMPORTANT: .download-container from before is now a *wrapper* for the button + dropdown */
.download-button-wrapper {
    /* New class for the wrapper */
    position: relative;
    display: inline-block; /* Makes it wrap content and allows absolute positioning of children */
}

#download-options {
    position: absolute;
    top: 100%; /* Position right below the button */
    left: 0;
    margin-top: 8px; /* Small gap below button */
    z-index: 10; /* Ensure it's on top of other content */
    background-color: white; /* Ensure background is set */
    border-radius: 0.5rem;
    box-shadow:
        0 4px 6px -1px rgba(0, 0, 0, 0.1),
        0 2px 4px -2px rgba(0, 0, 0, 0.06);
    padding: 1rem;
    width: 16rem; /* fixed width */
    border: 1px solid #e5e7eb;
}

.chart-image {
    max-width: 100%;
    height: auto;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    margin: 0.5rem 0;
}

.report-title {
    color: #1e40af;
    border-bottom: 2px solid #1e40af;
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
}

.report-section {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.report-header {
    background-color: #1e40af;
    color: white;
    padding: 1rem;
    border-radius: 0.5rem 0.5rem 0 0;
}

.report-body {
    padding: 1.5rem;
    background-color: white;
    border: 1px solid #e5e7eb;
    border-top: none;
    border-radius: 0 0 0.5rem 0.5rem;
}

.metric-card {
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1rem;
}

.metric-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: #1e40af;
}
.dashboard-container {
    background-color: rgba(255, 255, 255, 0.95); /* Slightly transparent white background */
    border-radius: 1.5rem; /* More rounded corners */
    box-shadow:
        0 20px 25px -5px rgba(0, 0, 0, 0.1),
        0 10px 10px -5px rgba(0, 0, 0, 0.04); /* Deeper shadow */
    padding: 2.5rem;
    max-width: 900px;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}
textarea {
    min-height: 150px;
    resize: vertical;
    font-size: 1.1rem;
}
button {
    transition: all 0.2s ease-in-out;
}
button:hover {
    transform: translateY(-2px);
    box-shadow:
        0 10px 15px -3px rgba(0, 0, 0, 0.1),
        0 4px 6px -2px rgba(0, 0, 0, 0.05);
}
.result-box {
    background-color: #f0f4f8; /* Light grey background */
    border-left: 5px solid;
    padding: 1rem 1.5rem;
    border-radius: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.result-box.positive {
    border-color: #10b981;
} /* Green for positive */
.result-box.negative {
    border-color: #ef4444;
} /* Red for negative */
.result-box.neutral {
    border-color: #6b7280;
} /* Gray for neutral */

.loading-spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-left-color: #3b82f6;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
    display: inline-block;
    vertical-align: middle;
    margin-left: 0.5rem;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

@keyframes pulse {
    0%,
    100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}
.animate-pulse {
    animation: pulse 1s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.emotion-tag {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    background-color: #eff6ff;
    color: #1e40af;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

/* Chart container styles */
.chart-container {
    margin-top: 1.5rem;
    position: relative;
    height: 300px; /* Fixed height for consistency */
    width: 100%;
}

.chart-title {
    text-align: center;
    font-weight: 600;
    color: #4b5563;
    margin-bottom: 0.5rem;
}

/* Tab styles for visualization options */
.visualization-tabs {
    display: flex;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 1rem;
}

.tab-button {
    padding: 0.5rem 1rem;
    background: none;
    border: none;
    cursor: pointer;
    font-weight: 500;
    color: #6b7280;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.tab-button.active {
    color: #3b82f6;
    border-bottom-color: #3b82f6;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* File upload styles */
.file-upload-container {
    border: 2px dashed #d1d5db;
    border-radius: 0.75rem;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.2s;
}

.file-upload-container.drag-over {
    border-color: #2563eb; /* blue-600 */
    background-color: #eff6ff; /* blue-50 */
}

.file-upload-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
}

.file-upload-icon {
    width: 3rem;
    height: 3rem;
    color: #3b82f6;
    margin-bottom: 0.5rem;
}

.file-info {
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: #6b7280;
}

.batch-results {
    margin-top: 1.5rem;
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 0.5rem;
}

.batch-result-item {
    padding: 0.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.batch-result-item:last-child {
    border-bottom: none;
}

/* Styles for Confusion Matrix table */
#confusion-matrix-table th,
#confusion-matrix-table td {
    padding: 0.75rem;
    border: 1px solid #e5e7eb;
    text-align: center;
}
#confusion-matrix-table thead th {
    background-color: #f9fafb;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.875rem;
    color: #4b5563;
}
#confusion-matrix-table tbody tr:nth-child(odd) {
    background-color: #f3f4f6;
}
#confusion-matrix-table tbody tr:hover {
    background-color: #e5e7eb;
}
#confusion-matrix-table tbody th {
    font-weight: 600;
    text-align: left;
    background-color: #f9fafb;
}
