:root {
    --primary: #2c3e50;
    --accent: #3498db;
    --bg: #f8f9fa;
    --card-bg: #ffffff;
    --text: #2c3e50;
    --text-light: #7f8c8d;
    --border: #e1e4e8;
}

body {
    font-family: "Inter", sans-serif;
    background-color: var(--bg);
    color: var(--text);
    margin: 0;
    padding: 0;
    line-height: 1.6;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
}

header {
    text-align: center;
    margin-bottom: 3rem;
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    color: var(--primary);
}

p {
    color: var(--text-light);
}

.search-box {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    background: var(--card-bg);
    padding: 1rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

input {
    flex: 1;
    padding: 0.8rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s;
}

input:focus {
    border-color: var(--accent);
}

button {
    padding: 0.8rem 2rem;
    background-color: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

button:hover {
    background-color: #1a252f;
}

button:disabled {
    background-color: var(--text-light);
    cursor: not-allowed;
}

.hidden {
    display: none !important;
}

/* Status Steps */
#status-container {
    margin-bottom: 2rem;
}

.status-step {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--card-bg);
    border: 1px solid var(--border);
    margin-bottom: 0.5rem;
    border-radius: 8px;
    opacity: 0.5;
    transition: all 0.3s;
}

.status-step.active {
    opacity: 1;
    border-color: var(--accent);
    box-shadow: 0 2px 4px rgba(52, 152, 219, 0.1);
}

.status-step.completed {
    opacity: 1;
    border-color: #2ecc71;
}

.step-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #eee;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
}

.active .step-icon {
    background: var(--accent);
    color: white;
    animation: pulse 1.5s infinite;
}

.completed .step-icon {
    background: #2ecc71;
    color: white;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(52, 152, 219, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(52, 152, 219, 0); }
    100% { box-shadow: 0 0 0 0 rgba(52, 152, 219, 0); }
}

/* Results */
.answer-card, .sources-card {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    margin-bottom: 2rem;
}

.answer-card h2, .sources-card h3 {
    margin-top: 0;
    color: var(--primary);
}

#answer-text {
    white-space: pre-wrap;
}

.source-item {
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 1rem;
    border-left: 4px solid var(--accent);
}

.source-meta {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 0.5rem;
    display: flex;
    gap: 1rem;
}

.source-text {
    font-style: italic;
}

/* Toggle Switch */
.mode-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.5rem;
}

.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
}

input:checked + .slider {
    background-color: var(--accent);
}

input:focus + .slider {
    box-shadow: 0 0 1px var(--accent);
}

input:checked + .slider:before {
    transform: translateX(26px);
}

.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

#mode-label {
    font-weight: 600;
    color: var(--primary);
    min-width: 120px;
    text-align: left;
}

.api-key-container {
    margin-bottom: 1rem;
    display: flex;
    justify-content: center;
}

#api-key-input {
    max-width: 300px;
    padding: 0.5rem;
    font-size: 0.9rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    text-align: center;
}

#api-key-input:focus {
    border-color: var(--accent);
}

/* Subtle Notice in Header */
.subtle-notice {
    margin: 1rem 0 0 0;
    padding: 0.6rem 1rem;
    background: #f5f5f5;
    border-left: 3px solid #999;
    color: #666;
    font-size: 0.85rem;
    border-radius: 4px;
    line-height: 1.4;
}

/* Footer with Collapsible Disclaimer */
.footer {
    text-align: center;
    padding: 2rem 1rem;
    border-top: 1px solid var(--border);
    margin-top: 3rem;
    color: var(--text-light);
    font-size: 0.9rem;
    background: #fafbfc;
}

.footer-text {
    margin: 0.5rem 0;
}

.footer strong {
    color: var(--primary);
}

/* Header Actions */
.header-actions {
    margin-top: 1rem;
    text-align: center;
}

.text-btn {
    background: none;
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text);
    text-decoration: none;
    cursor: pointer;
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
    transition: all 0.2s;
}

.text-btn:hover {
    background-color: #e9ecef;
    color: var(--primary);
    border-color: var(--text-light);
}

/* Modal Styles */
.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.modal.show {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background-color: #fff;
    padding: 2rem;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    position: relative;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    transform: translateY(20px);
    transition: transform 0.3s;
    max-height: 90vh;
    overflow-y: auto;
}

.modal.show .modal-content {
    transform: translateY(0);
}

.close-modal {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    font-size: 1.5rem;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
    transition: color 0.2s;
}

.close-modal:hover {
    color: #333;
}

.modal h2 {
    margin-top: 0;
    color: var(--primary);
    font-size: 1.5rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}

.alert-box {
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
}

.alert-box.warning {
    background-color: #fff3cd;
    border: 1px solid #ffeeba;
    color: #856404;
}

.alert-box h4 {
    margin-top: 0;
    margin-bottom: 0.5rem;
}

.alert-box ul {
    margin-bottom: 0;
    padding-left: 1.5rem;
}

.modal-footer {
    margin-top: 2rem;
    text-align: right;
    border-top: 1px solid var(--border);
    padding-top: 1rem;
}

.primary-btn {
    background-color: var(--primary);
    color: white;
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.2s;
}

.primary-btn:hover {
    background-color: #1a252f;
}
