/**
 * STR-AI Beta UI Styles
 *
 * Minimal, functional design.
 * No animations, no complex layouts.
 */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: #333;
    background: #f5f5f5;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
header {
    text-align: center;
    padding: 20px 0;
    border-bottom: 1px solid #ddd;
    margin-bottom: 30px;
}

header h1 {
    font-size: 24px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 5px;
}

header .subtitle {
    color: #666;
    font-size: 14px;
}

/* Main content */
main {
    flex: 1;
}

/* Form */
.query-section {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 24px;
}

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

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 8px;
    color: #333;
}

.form-group .help-text {
    display: block;
    font-weight: 400;
    font-size: 13px;
    color: #666;
    margin-top: 2px;
}

textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 16px;
    font-family: inherit;
    resize: vertical;
    min-height: 100px;
}

textarea:focus {
    outline: none;
    border-color: #0066cc;
    box-shadow: 0 0 0 2px rgba(0, 102, 204, 0.2);
}

input[type="date"] {
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 16px;
    font-family: inherit;
}

input[type="date"]:focus {
    outline: none;
    border-color: #0066cc;
    box-shadow: 0 0 0 2px rgba(0, 102, 204, 0.2);
}

/* Buttons */
.btn-primary {
    display: inline-block;
    padding: 12px 24px;
    background: #0066cc;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
}

.btn-primary:hover:not(:disabled) {
    background: #0052a3;
}

.btn-primary:disabled {
    background: #999;
    cursor: not-allowed;
}

.btn-link {
    background: none;
    border: none;
    color: #0066cc;
    font-size: 14px;
    cursor: pointer;
    margin-left: 10px;
    text-decoration: underline;
}

.btn-link:hover {
    color: #0052a3;
}

.btn-link:disabled {
    color: #999;
    cursor: not-allowed;
}

/* Loading */
.loading {
    text-align: center;
    padding: 40px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #eee;
    border-top-color: #0066cc;
    border-radius: 50%;
    margin: 0 auto 15px;
    animation: spin 1s linear infinite;
}

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

/* Error */
.error {
    background: #fff5f5;
    border: 1px solid #ff6b6b;
    border-radius: 8px;
    padding: 24px;
    color: #c92a2a;
}

.error h3 {
    margin-bottom: 10px;
    font-size: 18px;
}

.error .request-id {
    margin-top: 15px;
    font-size: 13px;
    color: #666;
}

/* Results */
.results {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 24px;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.result-header h2 {
    font-size: 20px;
    font-weight: 600;
    color: #1a1a1a;
}

.meta-info {
    font-size: 13px;
    color: #666;
}

.request-id-label {
    margin-right: 5px;
}

.copyable {
    cursor: pointer;
    padding: 2px 6px;
    background: #f0f0f0;
    border-radius: 3px;
    font-size: 12px;
}

.copyable:hover {
    background: #e0e0e0;
}

.copy-feedback {
    margin-left: 8px;
    color: #2ecc71;
    font-size: 12px;
}

/* Answer box */
.answer-box {
    background: #f9f9f9;
    border: 1px solid #eee;
    border-radius: 4px;
    padding: 20px;
    white-space: pre-wrap;
    font-size: 15px;
    line-height: 1.6;
}

/* Citations */
.citations-section {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.citations-section h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
    color: #333;
}

.citations-section ul {
    list-style: none;
}

.citations-section li {
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}

.citations-section li:last-child {
    border-bottom: none;
}

.citations-section a {
    color: #0066cc;
    text-decoration: none;
}

.citations-section a:hover {
    text-decoration: underline;
}

.source-type-badge {
    display: inline-block;
    margin-left: 10px;
    padding: 2px 8px;
    background: #e8f4fd;
    color: #0066cc;
    border-radius: 3px;
    font-size: 12px;
}

/* Phase 3.5.2: Pending URL indicator */
.citation-label {
    color: #333;
}

.url-pending {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 6px;
    background: #fff3cd;
    color: #856404;
    border-radius: 3px;
    font-size: 11px;
    cursor: help;
}

/* Action links */
.action-links {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.action-link {
    color: #0066cc;
    text-decoration: none;
    font-size: 14px;
}

.action-link:hover {
    text-decoration: underline;
}

/* Footer */
footer {
    text-align: center;
    padding: 20px 0;
    margin-top: 40px;
    border-top: 1px solid #ddd;
    font-size: 13px;
    color: #999;
}

/* Utility */
.hidden {
    display: none !important;
}

/* Responsive */
@media (max-width: 600px) {
    .container {
        padding: 15px;
    }

    .query-section,
    .results {
        padding: 16px;
    }

    .result-header {
        flex-direction: column;
    }

    .action-links {
        flex-direction: column;
        gap: 10px;
    }
}
