/* Gemini AI Sci-Fi Theme */

/* Root Variables */
:root {
    --background-color: #0a0f18;
    --primary-container-bg: #1a202c;
    --secondary-container-bg: #2d3748;
    --border-color: #4a5568;
    --text-color: #e2e8f0;
    --text-color-secondary: #a0aec0;
    --accent-color: #00e5ff;
    --accent-color-darker: #00b8cc;
    --system-message-bg: #2a4365;
    --error-color: #e53e3e;
    --font-family: 'Segoe UI', 'Roboto', 'Helvetica Neue', 'Arial', sans-serif;
}

/* General Body Styles */
body {
    margin: 0;
    font-family: var(--font-family);
    background: var(--background-color);
    color: var(--text-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    font-weight: 300;
}

/* Navigation Bar */
nav.navbar {
    width: 100%;
    background: var(--primary-container-bg);
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 4px 15px rgba(0, 229, 255, 0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 25px;
}

.logo {
    color: var(--accent-color);
    text-decoration: none;
    font-size: 1.8rem;
    font-weight: 600;
    text-shadow: 0 0 8px rgba(0, 229, 255, 0.5);
}

.nav-menu {
    list-style: none;
    display: flex;
    margin: 0;
    padding: 0;
}

.nav-menu li {
    margin-left: 30px;
}

.nav-menu a {
    color: var(--text-color-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s, text-shadow 0.3s;
    padding-bottom: 5px;
    border-bottom: 2px solid transparent;
}

.nav-menu a:hover, .nav-menu a.active {
    color: var(--accent-color);
    text-shadow: 0 0 5px rgba(0, 229, 255, 0.5);
    border-bottom-color: var(--accent-color);
}

/* Main Content Layout */
.content {
    width: 100%;
    max-width: 1200px;
    display: flex;
    gap: 30px;
    align-items: flex-start;
    justify-content: center;
    padding: 40px 20px;
}

.main {
    flex: 1;
    max-width: 500px;
}

h1, h2 {
    font-weight: 500;
    color: var(--text-color);
    text-shadow: 0 0 3px rgba(255, 255, 255, 0.1);
}

h1 {
    font-size: 2.5rem;
    color: #fff;
}

h2 {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
    margin-top: 30px;
    font-size: 1.5rem;
}

/* Forms & Buttons */
form {
    margin: 25px 0;
    display: flex;
    gap: 15px;
    align-items: center;
}

input[type="text"] {
    flex-grow: 1;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    background-color: var(--primary-container-bg);
    color: var(--text-color);
    transition: border-color 0.3s, box-shadow 0.3s;
}

input[type="text"]:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(0, 229, 255, 0.2);
}

button {
    padding: 12px 25px;
    background-image: linear-gradient(45deg, var(--accent-color) 0%, var(--accent-color-darker) 100%);
    border: none;
    border-radius: 8px;
    color: #0a0f18;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.3s;
    box-shadow: 0 4px 15px rgba(0, 229, 255, 0.1);
}

button:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 229, 255, 0.3);
}

/* Custom File Upload Button */
#upload-form {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 15px;
}

input[type="file"] {
    display: none; /* Hide the default input */
}

/* Custom file input button */
.file-upload-label {
    padding: 12px 20px;
    background-color: var(--secondary-container-bg);
    border: 1px dashed var(--border-color);
    border-radius: 8px;
    color: var(--text-color-secondary);
    cursor: pointer;
    transition: background-color 0.3s, border-color 0.3s;
    flex-grow: 1;
    text-align: center;
}

.file-upload-label:hover {
    background-color: var(--primary-container-bg);
    border-color: var(--accent-color);
    color: var(--accent-color);
}


/* Metrics Table */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background: var(--primary-container-bg);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    border: 1px solid var(--border-color);
}

table th, table td {
    padding: 14px 18px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

table th {
    background-color: var(--secondary-container-bg);
    font-weight: 600;
    color: var(--text-color);
}

table tr:last-child td {
    border-bottom: none;
}

/* Chat Container */
.chat-container {
    flex: 1;
    max-width: 700px;
    height: 75vh;
    display: flex;
    flex-direction: column;
    background: var(--primary-container-bg);
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.chat-header {
    padding: 15px;
    background: var(--secondary-container-bg);
    color: var(--accent-color);
    font-weight: 600;
    font-size: 1.2rem;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
    text-shadow: 0 0 5px rgba(0, 229, 255, 0.3);
}

.chat {
    flex-grow: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
    background-color: var(--background-color);
}

/* Chat Messages */
.chat-message {
    padding: 12px 18px;
    border-radius: 18px;
    max-width: 85%;
    line-height: 1.6;
    word-wrap: break-word;
    font-weight: 400;
}

.chat-message strong {
    display: none;
}

.chat-message.user {
    align-self: flex-end;
    background: var(--accent-color);
    color: #0a0f18;
    border-bottom-right-radius: 4px;
    font-weight: 500;
}

.chat-message.agent {
    align-self: flex-start;
    background: var(--secondary-container-bg);
    color: var(--text-color);
    border-bottom-left-radius: 4px;
}

.chat-message.system {
    align-self: center;
    font-style: italic;
    color: var(--text-color-secondary);
    font-size: 0.9rem;
    background: var(--system-message-bg);
    border-radius: 8px;
}

/* Spinner */
.spinner {
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--accent-color);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Design */
.nav-toggle {
    display: none;
}
.nav-toggle-label {
    display: none;
    font-size: 1.8rem;
    cursor: pointer;
}

@media (max-width: 900px) {
    .content {
        flex-direction: column;
        align-items: center;
    }
    .main, .chat-container {
        width: 100%;
        max-width: 700px;
    }
    .chat-container {
        height: 65vh;
    }
}

@media (max-width: 600px) {
    .nav-menu {
        position: absolute;
        top: 100%;
        right: 0;
        background: var(--primary-container-bg);
        flex-direction: column;
        width: 200px;
        display: none;
        border: 1px solid var(--border-color);
        box-shadow: 0 8px 16px rgba(0,0,0,0.3);
    }
    .nav-menu li {
        margin: 0;
        width: 100%;
    }
    .nav-menu a {
        display: block;
        padding: 12px 20px;
        width: 100%;
        border: none;
    }
    .nav-toggle:checked + .nav-toggle-label + .nav-menu {
        display: flex;
    }
    .nav-toggle-label {
        display: block;
        color: var(--text-color);
    }
    h1 {
        font-size: 2rem;
    }
    form {
        flex-direction: column;
        align-items: stretch;
    }
}

/* Generic Component Styles (Added for consistency) */
.btn {
    padding: 12px 25px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.3s, background-color 0.3s, opacity 0.3s;
    border: none;
    background-image: none; /* Reset for specific button types */
    background-color: var(--accent-color);
    color: #0a0f18;
    box-shadow: 0 4px 15px rgba(0, 229, 255, 0.1);
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 229, 255, 0.3);
}

.btn:disabled {
    background-color: var(--secondary-container-bg);
    color: var(--text-color-secondary);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-danger {
    background-color: var(--error-color);
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(229, 62, 62, 0.2);
}

.btn-danger:hover {
    background-color: var(--error-color); /* Keep color on hover */
    opacity: 0.9;
    box-shadow: 0 6px 20px rgba(229, 62, 62, 0.4);
}

.form-control {
    padding: 10px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background-color: var(--primary-container-bg);
    color: var(--text-color);
    font-size: 1rem;
}