/* static/css/index.css */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary-color: #64748b;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --border-color: #e2e8f0;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.header {
    text-align: center;
    padding: 40px 0 30px;
}

.logo {
    font-size: 48px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.subtitle {
    font-size: 18px;
    color: var(--text-secondary);
}

.main {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 30px;
    margin-top: 30px;
}

.search-section {
    grid-column: 1 / -1;
}

.search-box {
    display: flex;
    gap: 10px;
    max-width: 800px;
    margin: 0 auto;
}

#searchInput {
    flex: 1;
    padding: 15px 20px;
    font-size: 16px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    outline: none;
    transition: border-color 0.3s;
}

#searchInput:focus {
    border-color: var(--primary-color);
}

.search-btn {
    padding: 15px 35px;
    font-size: 16px;
    font-weight: 600;
    color: white;
    background-color: var(--primary-color);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.search-btn:hover {
    background-color: var(--primary-hover);
}

.search-examples {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 15px;
    flex-wrap: wrap;
}

.example-label {
    color: var(--text-secondary);
    font-size: 14px;
}

.example-btn {
    padding: 8px 16px;
    font-size: 14px;
    color: var(--primary-color);
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s;
}

.example-btn:hover {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.filter-section {
    grid-column: 1 / -1;
    display: flex;
    gap: 20px;
    align-items: center;
    padding: 15px 20px;
    background-color: var(--card-bg);
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.filter-group label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
}

.filter-group select {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    outline: none;
    cursor: pointer;
}

.result-info {
    margin-left: auto;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
}

.news-section {
    min-height: 500px;
}

.loading-spinner {
    text-align: center;
    padding: 60px 20px;
}

.spinner {
    width: 50px;
    height: 50px;
    margin: 0 auto 20px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.news-container {
    display: grid;
    gap: 20px;
}

.news-card {
    display: flex;
    gap: 20px;
    padding: 20px;
    background-color: var(--card-bg);
    border-radius: 12px;
    box-shadow: var(--shadow);
    transition: all 0.3s;
    cursor: pointer;
}

.news-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.news-thumbnail {
    width: 200px;
    height: 150px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
}

.news-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.news-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 10px;
}

.news-category {
    display: inline-block;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 600;
    color: var(--primary-color);
    background-color: rgba(37, 99, 235, 0.1);
    border-radius: 12px;
}

.news-date {
    font-size: 14px;
    color: var(--text-secondary);
}

.news-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 10px;
    line-height: 1.4;
}

.news-description {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 15px;
}

.news-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}

.news-source {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
}

.news-link {
    font-size: 14px;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.news-link:hover {
    text-decoration: underline;
}

.empty-state {
    text-align: center;
    padding: 80px 20px;
}

.empty-icon {
    width: 80px;
    height: 80px;
    color: var(--text-secondary);
    margin: 0 auto 20px;
}

.empty-state h3 {
    font-size: 24px;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.empty-state p {
    font-size: 16px;
    color: var(--text-secondary);
}

.sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.sidebar-section {
    padding: 20px;
    background-color: var(--card-bg);
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.sidebar-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--text-primary);
}

.trending-list,
.history-list {
    list-style: none;
}

.trending-list li,
.history-list li {
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: color 0.3s;
}

.trending-list li:last-child,
.history-list li:last-child {
    border-bottom: none;
}

.trending-list li:hover,
.history-list li:hover {
    color: var(--primary-color);
}

.trending-item,
.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.trending-query,
.history-query {
    font-size: 14px;
    font-weight: 500;
}

.trending-count {
    font-size: 12px;
    color: var(--text-secondary);
}

.history-date {
    font-size: 12px;
    color: var(--text-secondary);
}

@media (max-width: 1024px) {
    .main {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        order: -1;
    }
}

@media (max-width: 768px) {
    .logo {
        font-size: 36px;
    }
    
    .search-box {
        flex-direction: column;
    }
    
    .news-card {
        flex-direction: column;
    }
    
    .news-thumbnail {
        width: 100%;
        height: 200px;
    }
    
    .filter-section {
        flex-direction: column;
        align-items: stretch;
    }
    
    .result-info {
        margin-left: 0;
    }
}