:root {
    --primary: #2c3e50;
    --secondary: #34495e;
    --accent: #3498db;
    --success: #2ecc71;
    --bg: #f8f9fa;
    --text: #2c3e50;
    --white: #ffffff;
    --error: #e74c3c;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    margin: 0;
    line-height: 1.6;
}

/* Login Page Styling */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    background: linear-gradient(135deg, var(--primary) 0%, #1a252f 100%);
}

.login-card {
    background: var(--white);
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 350px;
    text-align: center;
}

.login-card h2 { margin-bottom: 25px; color: var(--primary); }

.login-card input {
    width: 100%;
    padding: 12px;
    margin-bottom: 20px;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-sizing: border-box;
}

.error { color: var(--error); font-size: 0.9rem; margin-bottom: 15px; }

/* Navigation */
nav {
    background: var(--primary);
    color: white;
    padding: 1rem 0;
}

.nav-container {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}

.logo { font-weight: 800; font-size: 1.4rem; letter-spacing: 2px; }

.nav-links a {
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    margin-left: 20px;
    font-size: 0.9rem;
    transition: color 0.3s;
}

.nav-links a.active, .nav-links a:hover { color: white; }

.nav-links a.logout { color: #fab1a0; }

/* Main Container */
.container {
    max-width: 800px;
    margin: 40px auto;
    background: var(--white);
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

h1 { margin-top: 0; font-size: 1.8rem; border-bottom: 2px solid #f0f0f0; padding-bottom: 10px; }

/* Form Elements */
.category-selector { margin-bottom: 30px; }
.category-selector label { display: block; margin-bottom: 10px; font-weight: 600; }

select, input[type="text"], textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    box-sizing: border-box;
    background-color: #fafafa;
}

.question-card {
    padding: 20px;
    background: #fcfcfc;
    border: 1px solid #f0f0f0;
    border-radius: 8px;
    margin-bottom: 20px;
}

.question-card h3 { font-size: 1rem; margin-top: 0; margin-bottom: 15px; color: var(--secondary); }

.custom-input { margin-top: 15px; border-color: var(--accent); }

.hidden { display: none; }

.primary-btn {
    background: var(--accent);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    transition: transform 0.2s, background 0.2s;
}

.primary-btn:hover { background: #2980b9; transform: translateY(-2px); }

.secondary-btn {
    background: var(--success);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 6px;
    cursor: pointer;
}

/* History Cards */
.history-card {
    padding: 20px;
    border: 1px solid #eee;
    border-radius: 10px;
    margin-bottom: 20px;
    background: #fff;
    position: relative;
}

.history-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
}

.cat-badge {
    background: #e1f5fe;
    color: #039be5;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
}

.timestamp { color: #95a5a6; font-size: 0.8rem; }

.history-content { color: #555; font-style: italic; margin-bottom: 15px; }

.copy-small-btn {
    background: #f0f0f0;
    border: none;
    padding: 5px 15px;
    border-radius: 4px;
    font-size: 0.8rem;
    cursor: pointer;
}

#result-container {
    margin-top: 40px;
    border-top: 3px solid var(--accent);
    padding-top: 20px;
}

#result-text { height: 120px; margin-bottom: 20px; background: #fffdf0; border-color: #ffeaa7; }

#copy-status { text-align: center; color: var(--success); font-weight: bold; }

/* Agent Bubble */
.agent-bubble {
    background: #e1f5fe;
    border-left: 5px solid var(--accent);
    padding: 15px 20px;
    border-radius: 0 12px 12px 0;
    margin-bottom: 30px;
    position: relative;
}

.agent-name {
    font-weight: 800;
    font-size: 0.8rem;
    color: var(--accent);
    text-transform: uppercase;
    display: block;
    margin-bottom: 5px;
}

#agent-comment {
    margin: 0;
    font-style: italic;
    color: var(--secondary);
}

/* Extra Fields */
.extra-fields {
    margin: 20px 0;
    padding: 20px;
    background: #fcfcfc;
    border: 1px dashed #ddd;
    border-radius: 8px;
}

.form-group { margin-bottom: 20px; text-align: left; }
.form-group label { display: block; margin-bottom: 8px; font-weight: 600; font-size: 0.9rem; }

/* Email Button */
.email-btn {
    background: #9b59b6;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 6px;
    cursor: pointer;
    margin-left: 10px;
}

.email-btn:hover { background: #8e44ad; }

.action-btns { display: flex; gap: 10px; justify-content: center; }

/* Settings Help Text */
.help-text {
    font-size: 0.85rem;
    color: #7f8c8d;
    background: #fff9db;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 20px;
}

/* Dashboard & Stats */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #f0f0f0;
    margin-bottom: 30px;
    padding-bottom: 10px;
}

.dashboard-header h1 { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }

.stats-container {
    display: flex;
    flex-direction: column;
    gap: 5px;
    align-items: flex-end;
}

.system-stats, .network-stats {
    display: flex;
    gap: 15px;
    background: #edf2f7;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    color: #4a5568;
}

.stat-item span { color: var(--accent); }

.status-indicator {
    padding: 2px 8px;
    border-radius: 10px;
    color: white !important;
}

.online { background: var(--success); }
.offline { background: var(--error); }

/* File Manager */
.file-list { margin-top: 20px; }

.file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: #fff;
    border: 1px solid #edf2f7;
    border-radius: 8px;
    margin-bottom: 10px;
    transition: background 0.2s;
}

.file-item:hover { background: #f7fafc; }

.file-name { font-weight: 500; font-size: 0.9rem; }

.download-link {
    color: var(--accent);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
}

.download-link:hover { text-decoration: underline; }

.upload-section {
    background: #f8fafc;
    padding: 20px;
    border-radius: 8px;
    border: 2px dashed #cbd5e0;
    text-align: center;
    margin-bottom: 30px;
}

.upload-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-bottom: 10px;
}

.custom-file-upload {
    border: 1px solid #ccc;
    display: inline-block;
    padding: 12px 20px;
    cursor: pointer;
    background: white;
    border-radius: 8px;
    font-weight: 600;
    transition: background 0.2s;
}

.custom-file-upload:hover { background: #f0f0f0; }

input[type="file"] { display: none; }

#file-count-display {
    font-size: 0.9rem;
    color: #718096;
    margin-bottom: 10px;
}

.processing-badge { font-size: 0.8rem; color: #d35400; margin-left: 10px; background: #fdf2e9; padding: 2px 6px; border-radius: 4px; }
.queued-badge { font-size: 0.8rem; color: #2980b9; margin-left: 10px; background: #ebf5fb; padding: 2px 6px; border-radius: 4px; }
.done-badge { font-size: 0.8rem; color: #27ae60; margin-left: 10px; background: #eafaf1; padding: 2px 6px; border-radius: 4px; }

