/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2563eb;
    --secondary-color: #1e40af;
    --text-dark: #1f2937;
    --text-light: #6b7280;
    --bg-light: #f9fafb;
    --bg-white: #ffffff;
    --border-color: #e5e7eb;
    --meta-color: #0668E1;
    --google-color: #4285F4;
    --openai-color: #10a37f;
    --tesla-color: #cc0000;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--text-dark);
    background-color: var(--bg-light);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background-color: var(--bg-white);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--border-color);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary-color);
}

.logo i {
    font-size: 1.75rem;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.nav {
    display: flex;
    gap: 8px;
}

.nav-link {
    padding: 10px 20px;
    text-decoration: none;
    color: var(--text-light);
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.nav-link:hover {
    background-color: var(--bg-light);
    color: var(--text-dark);
}

.nav-link.active {
    background-color: var(--primary-color);
    color: white;
}

/* Language Switch */
.language-switch {
    display: flex;
    gap: 4px;
    background-color: var(--bg-light);
    padding: 4px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.lang-btn {
    padding: 8px 16px;
    border: none;
    background-color: transparent;
    color: var(--text-light);
    font-weight: 500;
    font-size: 0.875rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.lang-btn:hover {
    color: var(--text-dark);
    background-color: rgba(37, 99, 235, 0.1);
}

.lang-btn.active {
    background-color: var(--primary-color);
    color: white;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 80px 0;
    text-align: center;
}

.hero-title {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

.hero-subtitle {
    font-size: 1.25rem;
    opacity: 0.95;
    font-weight: 400;
}

/* Search Section */
.search-section {
    padding: 40px 0;
}

.search-box {
    position: relative;
    max-width: 600px;
    margin: 0 auto;
}

.search-box i {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    font-size: 1.125rem;
}

.search-box input {
    width: 100%;
    padding: 16px 20px 16px 56px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
    background-color: var(--bg-white);
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* News Section */
.news-section {
    padding: 40px 0 80px;
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
}

.news-card {
    background-color: var(--bg-white);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
    cursor: pointer;
    border: 1px solid var(--border-color);
}

.news-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
}

.news-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

.company-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.875rem;
    color: white;
}

.company-badge i {
    font-size: 1rem;
}

.company-badge.meta {
    background-color: var(--meta-color);
}

.company-badge.google {
    background-color: var(--google-color);
}

.company-badge.openai {
    background-color: var(--openai-color);
}

.company-badge.tesla {
    background-color: var(--tesla-color);
}

.news-date {
    color: var(--text-light);
    font-size: 0.875rem;
    font-weight: 500;
}

.news-card-body {
    padding: 24px;
}

.news-title {
    font-size: 1.375rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-dark);
    line-height: 1.4;
}

.news-description {
    color: var(--text-light);
    font-size: 1rem;
    line-height: 1.7;
    margin-bottom: 20px;
}

.news-card-footer {
    padding: 0 24px 24px;
}

.read-more {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.9375rem;
    text-decoration: none;
    transition: gap 0.3s ease;
}

.read-more:hover {
    gap: 12px;
}

.read-more i {
    font-size: 0.875rem;
}

/* No Results */
.no-results {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
}

.no-results i {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.3;
}

.no-results p {
    font-size: 1.25rem;
    font-weight: 500;
}

/* Footer */
.footer {
    background-color: var(--text-dark);
    color: white;
    padding: 40px 0;
    margin-top: auto;
}

.footer .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer p {
    opacity: 0.8;
}

.social-links {
    display: flex;
    gap: 16px;
}

.social-links a {
    color: white;
    font-size: 1.25rem;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.social-links a:hover {
    opacity: 1;
}

/* Live News Section */
.live-news-section {
    padding: 60px 0 80px;
    background-color: var(--bg-white);
}

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

.live-news-header h2 {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 12px;
}

.refresh-info {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-light);
    font-size: 0.9375rem;
}

.refresh-info i {
    animation: gentle-spin 3s linear infinite;
}

@keyframes gentle-spin {
    0% { transform: rotate(0deg); }
    10% { transform: rotate(360deg); }
    100% { transform: rotate(360deg); }
}

.live-news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.live-news-card {
    background-color: var(--bg-white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.live-news-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.live-news-card a {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.live-news-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
    background-color: var(--bg-light);
}

.live-news-content {
    padding: 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.live-news-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-dark);
    line-height: 1.5;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.live-news-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}

.live-news-source {
    font-size: 0.8125rem;
    color: var(--primary-color);
    font-weight: 500;
}

.live-news-date {
    font-size: 0.8125rem;
    color: var(--text-light);
}

.live-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    background: linear-gradient(135deg, #ff0000, #ff4444);
    color: white;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 12px;
    width: fit-content;
}

.live-badge i {
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.loading-spinner {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
    grid-column: 1 / -1;
}

.loading-spinner i {
    font-size: 3rem;
    margin-bottom: 16px;
}

.loading-spinner p {
    font-size: 1.125rem;
}

.error-message {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-light);
    grid-column: 1 / -1;
}

.error-message i {
    font-size: 2.5rem;
    margin-bottom: 12px;
    opacity: 0.5;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 20px;
    }

    .header-right {
        width: 100%;
        flex-direction: column;
        gap: 16px;
    }

    .nav {
        width: 100%;
        flex-wrap: wrap;
        justify-content: center;
    }

    .nav-link {
        padding: 8px 16px;
        font-size: 0.875rem;
    }

    .language-switch {
        align-self: center;
    }

    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .news-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .footer .container {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }

    .live-news-grid {
        grid-template-columns: 1fr;
    }

    .live-news-header h2 {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .hero {
        padding: 50px 0;
    }

    .hero-title {
        font-size: 1.75rem;
    }

    .search-section {
        padding: 30px 0;
    }

    .news-card-body {
        padding: 20px;
    }

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