/* Tech News Section Styles */
.tech-news-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    padding: 1rem;
    max-width: 1200px;
    margin: 0 auto;
}

.news-card {
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.news-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.news-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: #f5f5f5;
}

.news-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.news-card:hover .news-image img {
    transform: scale(1.05);
}

.news-content {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.news-title {
    margin: 0 0 1rem;
    font-size: 1.2rem;
    line-height: 1.4;
}

.news-title a {
    color: #2c3e50;
    text-decoration: none;
    transition: color 0.2s ease;
}

.news-title a:hover {
    color: #3498db;
}

.news-description {
    color: #666;
    font-size: 0.95rem;
    line-height: 1.5;
    margin: 0 0 1rem;
    flex-grow: 1;
}

.news-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #888;
    font-size: 0.875rem;
    margin-top: auto;
}

.news-source, .news-time {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.news-source i, .news-time i {
    color: #3498db;
    font-size: 1rem;
}

/* Category-specific styles */
.news-card.gpu {
    border-left: 4px solid #e74c3c;
}

.news-card.cpu {
    border-left: 4px solid #3498db;
}

.news-card.price {
    border-left: 4px solid #2ecc71;
}

.news-card.hardware {
    border-left: 4px solid #f39c12;
}

/* Loading and Error States */
.loading {
    text-align: center;
    padding: 2rem;
    color: #666;
    font-size: 1.1rem;
}

.loading i {
    color: #3498db;
    font-size: 2rem;
    margin-bottom: 1rem;
    display: block;
}

.error {
    text-align: center;
    padding: 2rem;
    color: #e74c3c;
    background: #fdf0ed;
    border-radius: 8px;
    margin: 1rem;
}

.error i {
    font-size: 2rem;
    margin-bottom: 1rem;
    display: block;
}

.retry-button {
    background: #3498db;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 1rem;
    transition: background 0.2s ease;
}

.retry-button:hover {
    background: #2980b9;
}

.retry-button i {
    margin-right: 0.5rem;
    font-size: 1rem;
}

/* Search Form */
.search-form {
    display: flex;
    gap: 0.5rem;
    max-width: 600px;
    margin: 1rem auto;
    padding: 0 1rem;
}

.search-form input {
    flex: 1;
    padding: 0.75rem;
    border: 2px solid #eee;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.2s ease;
}

.search-form input:focus {
    border-color: #3498db;
    outline: none;
}

.search-form button {
    background: #3498db;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.search-form button:hover {
    background: #2980b9;
}

.search-form button i {
    font-size: 1rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .tech-news-container {
        grid-template-columns: 1fr;
        padding: 0.5rem;
    }

    .news-card {
        margin-bottom: 1rem;
    }

    .news-title {
        font-size: 1.1rem;
    }

    .news-image {
        height: 180px;
    }

    .search-form {
        flex-direction: column;
    }

    .search-form button {
        width: 100%;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.news-card {
    animation: fadeIn 0.5s ease-out forwards;
}

.loading i.fa-spinner {
    animation: spin 1s linear infinite;
}
