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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #f5f7fa;
    padding: 20px;
}

.container {
    max-width: 900px;
    margin: 0 auto;
}

header {
    text-align: center;
    margin-bottom: 40px;
}

h1 {
    font-size: 2.5rem;
    color: #2c3e50;
    margin-bottom: 10px;
}

.subtitle {
    color: #7f8c8d;
    font-size: 1.1rem;
}

form {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

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

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
}

input[type="text"],
input[type="date"] {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.3s;
}

input[type="text"]:focus,
input[type="date"]:focus {
    outline: none;
    border-color: #3498db;
}

.help-text {
    font-size: 0.875rem;
    color: #7f8c8d;
    margin-top: 6px;
}

button[type="submit"] {
    width: 100%;
    background: #3498db;
    color: white;
    padding: 14px 30px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

button[type="submit"]:hover {
    background: #2980b9;
}

button[type="submit"]:disabled {
    background: #95a5a6;
    cursor: not-allowed;
}

#results {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.results-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #ecf0f1;
}

.results-header h2 {
    color: #2c3e50;
    margin-bottom: 10px;
}

.result-count {
    color: #7f8c8d;
    font-size: 1rem;
}

.result-item {
    margin-bottom: 25px;
    padding: 20px;
    border: 1px solid #ecf0f1;
    border-radius: 6px;
    background: #fafafa;
    transition: box-shadow 0.3s;
}

.result-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
    gap: 15px;
}

.result-header h3 {
    color: #2c3e50;
    font-size: 1.25rem;
    margin: 0;
    flex: 1;
}

.relevance-badge {
    background: #2ecc71;
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
}

.relevance-badge.medium {
    background: #f39c12;
}

.relevance-badge.low {
    background: #95a5a6;
}

.result-meta {
    display: flex;
    gap: 15px;
    color: #7f8c8d;
    font-size: 0.9rem;
    margin-bottom: 12px;
}

.post-title-link {
    font-weight: 600;
    color: #2980b9;
    text-decoration: none;
}

.post-title-link:hover {
    text-decoration: underline;
    color: #3498db;
}

.post-date {
    font-style: italic;
}

.result-content {
    margin: 15px 0;
    padding: 15px;
    background: white;
    border-left: 3px solid #3498db;
    border-radius: 4px;
    color: #555;
    line-height: 1.7;
}

.result-content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 15px 0;
    border-radius: 4px;
}

.result-reasoning {
    font-size: 0.875rem;
    color: #7f8c8d;
    font-style: italic;
    padding-top: 10px;
    border-top: 1px solid #ecf0f1;
}

.error {
    background: #e74c3c;
    color: white;
    padding: 15px 20px;
    border-radius: 6px;
    margin-bottom: 20px;
}

@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

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

    .relevance-badge {
        align-self: flex-start;
    }
}
