/* Base Styles */
:root {
    --primary-color: #0088cc;
    --primary-dark: #006699;
    --secondary-color: #5b5b5b;
    --accent-color: #ff9500;
    --light-bg: #f8f9fa;
    --dark-bg: #1f2937;
    --text-light: #ffffff;
    --text-dark: #333333;
    --text-muted: #6c757d;
    --border-color: #e1e4e8;
    --card-bg: #ffffff;
    --card-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
    --border-radius: 8px;
}

/* Dark Mode Variables */
.dark-mode {
    --light-bg: #121212;
    --dark-bg: #1f1f1f;
    --text-dark: #f8f9fa;
    --text-muted: #adb5bd;
    --border-color: #2d3748;
    --card-bg: #2d3748;
    --card-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

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

html, body {
    height: 100%;
}

body {
    font-family: 'Roboto', sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--light-bg);
    transition: var(--transition);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

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

a {
    text-decoration: none;
    color: var(--primary-color);
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

img {
    max-width: 100%;
    height: auto;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border-radius: var(--border-radius);
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    font-size: 16px;
    gap: 8px;
}

.primary-btn {
    background-color: var(--primary-color);
    color: var(--text-light);
}

.primary-btn:hover {
    background-color: var(--primary-dark);
    color: var(--text-light);
    transform: translateY(-2px);
}

.secondary-btn {
    background-color: transparent;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

.secondary-btn:hover {
    background-color: rgba(0, 136, 204, 0.1);
    transform: translateY(-2px);
}

.section-header {
    text-align: center;
    margin-bottom: 50px;
}

.section-header h2 {
    font-size: 36px;
    margin-bottom: 15px;
    position: relative;
    display: inline-block;
}

.section-header h2::after {
    content: '';
    position: absolute;
    width: 60px;
    height: 3px;
    background-color: var(--primary-color);
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
}

.section-header p {
    color: var(--text-muted);
    font-size: 18px;
    max-width: 600px;
    margin: 0 auto;
}

/* Header Styles */
header {
    background-color: var(--card-bg);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 15px 0;
}

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

.logo a {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
}

.logo i {
    font-size: 28px;
}

.nav-links {
    display: flex;
    gap: 25px;
}

.nav-links a {
    color: var(--text-dark);
    font-weight: 500;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    bottom: -5px;
    left: 0;
    transition: var(--transition);
}

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}

.theme-toggle {
    cursor: pointer;
    font-size: 20px;
    color: var(--text-dark);
}

/* Hero Section */
.hero {
    padding: 80px 0;
    background: linear-gradient(135deg, var(--primary-color) 0%, #00a1ff 100%);
    color: var(--text-light);
    text-align: center;
    flex: 1;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.hero h1 {
    font-size: 48px;
    margin-bottom: 20px;
    line-height: 1.2;
}

.hero p {
    font-size: 20px;
    margin-bottom: 40px;
    opacity: 0.9;
}

.search-container {
    margin-bottom: 40px;
    position: relative;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.search-container form {
    display: flex;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    border-radius: var(--border-radius);
    overflow: hidden;
}

.search-container input {
    flex: 1;
    padding: 18px 24px;
    border: none;
    font-size: 16px;
    outline: none;
}

.search-container button {
    background-color: var(--text-light);
    color: var(--primary-color);
    border: none;
    padding: 0 25px;
    cursor: pointer;
    font-size: 18px;
    transition: var(--transition);
}

.search-container button:hover {
    background-color: var(--accent-color);
    color: var(--text-light);
}

.hero-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

/* Features Section */
.features {
    padding: 80px 0;
    background-color: var(--light-bg);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.feature-card {
    background-color: var(--card-bg);
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    text-align: center;
    transition: var(--transition);
}

.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.feature-icon {
    width: 70px;
    height: 70px;
    background-color: rgba(0, 136, 204, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.feature-icon i {
    font-size: 30px;
    color: var(--primary-color);
}

.feature-card h3 {
    margin-bottom: 15px;
    font-size: 20px;
}

.feature-card p {
    color: var(--text-muted);
}

/* Trending Section */
.trending {
    padding: 80px 0;
    background-color: var(--card-bg);
}

.trending-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 50px;
    justify-content: center;
}

.tag {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    background-color: rgba(0, 136, 204, 0.1);
    border-radius: 30px;
    color: var(--primary-color);
    font-weight: 500;
    transition: var(--transition);
}

.tag span {
    background-color: var(--primary-color);
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    margin-left: 8px;
}

.tag:hover {
    background-color: var(--primary-color);
    color: white;
}

.tag:hover span {
    background-color: white;
    color: var(--primary-color);
}

.recent-searches h3 {
    text-align: center;
    margin-bottom: 30px;
    font-size: 24px;
}

.search-results {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.result-card {
    background-color: var(--light-bg);
    border-radius: var(--border-radius);
    padding: 25px;
    box-shadow: var(--card-shadow);
    transition: var(--transition);
}

.result-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
}

.result-date {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 10px;
}

.result-card h4 {
    margin-bottom: 10px;
    font-size: 18px;
    line-height: 1.4;
}

.result-card p {
    color: var(--text-muted);
    margin-bottom: 15px;
    font-size: 14px;
}

.result-tags {
    display: flex;
    gap: 10px;
}

.result-tags span {
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 20px;
}

.category {
    background-color: rgba(0, 136, 204, 0.1);
    color: var(--primary-color);
}

.source {
    background-color: rgba(255, 149, 0, 0.1);
    color: var(--accent-color);
}

/* How It Works Section */
.how-it-works {
    padding: 80px 0;
    background-color: var(--light-bg);
}

.steps {
    display: flex;
    justify-content: space-between;
    gap: 30px;
    flex-wrap: wrap;
}

.step {
    flex: 1;
    min-width: 250px;
    text-align: center;
    position: relative;
}

.step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 40px;
    right: -15px;
    width: 30px;
    height: 2px;
    background-color: var(--primary-color);
    display: none;
}

@media (min-width: 768px) {
    .step:not(:last-child)::after {
        display: block;
    }
}

.step-number {
    width: 80px;
    height: 80px;
    background-color: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    font-weight: 700;
    margin: 0 auto 20px;
}

.step h3 {
    margin-bottom: 15px;
    font-size: 20px;
}

.step p {
    color: var(--text-muted);
}

/* Call to Action */
.cta {
    padding: 80px 0;
    background: linear-gradient(135deg, var(--primary-color) 0%, #00a1ff 100%);
    color: var(--text-light);
    text-align: center;
}

.cta-content {
    max-width: 700px;
    margin: 0 auto;
}

.cta h2 {
    font-size: 36px;
    margin-bottom: 20px;
}

.cta p {
    margin-bottom: 30px;
    font-size: 18px;
    opacity: 0.9;
}

/* Footer */
footer {
    background-color: var(--dark-bg);
    color: var(--text-light);
    padding: 60px 0 20px;
    margin-top: auto;
}

.footer-content {
    display: flex;
    align-items: flex-start;
    margin-bottom: 40px;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 24px;
    font-weight: 700;
    color: var(--text-light);
    margin-bottom: 20px;
}

.footer-logo i {
    font-size: 28px;
    color: var(--primary-color);
}

.footer-links {
    display: flex;
    position: relative;
    flex: 1;
    flex-wrap: wrap;
    gap: 40px;
    justify-content: center;
    align-items: flex-start;
}

.footer-column h4 {
    margin-bottom: 20px;
    font-size: 18px;
    position: relative;
    display: inline-block;
}

.footer-column h4::after {
    content: '';
    position: absolute;
    width: 30px;
    height: 2px;
    background-color: var(--primary-color);
    bottom: -8px;
    left: 0;
}

.footer-column a {
    display: block;
    color: #adb5bd;
    margin-bottom: 10px;
    transition: var(--transition);
}

.footer-column a:hover {
    color: var(--text-light);
    transform: translateX(5px);
}

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

.social-links a {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    font-size: 18px;
    transition: var(--transition);
}

.social-links a:hover {
    background-color: var(--primary-color);
    transform: translateY(-5px);
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: #adb5bd;
    font-size: 14px;
}

.footer-links .footer-column:last-child {
    position: absolute;
    right: 0;
    top: 0;
    margin-left: 0;
}

/* Ensure full-page background */
html {
    background-color: var(--light-bg);
}

/* Buffer progress bar */
.buffer-container {
    width: 100%;
    background: rgba(0,0,0,0.1);
    border-radius: 4px;
    margin: 10px 0;
    height: 8px;
    overflow: hidden;
}

.buffer-bar {
    width: 0%;
    height: 100%;
    background: var(--primary-color);
    transition: width 0.2s ease;
}

.buffer-text {
    font-size: 12px;
    text-align: center;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Responsive Design */
@media (max-width: 992px) {
    .hero h1 {
        font-size: 36px;
    }
    
    .hero p {
        font-size: 18px;
    }
    
    .section-header h2 {
        font-size: 30px;
    }
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 20px;
    }
    
    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .hero {
        padding: 60px 0;
    }
    
    .hero h1 {
        font-size: 30px;
    }
    
    .search-container input {
        padding: 14px 20px;
    }
    
    .steps {
        flex-direction: column;
    }
    
    .step:not(:last-child)::after {
        display: none;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 30px;
    }
    
    .footer-links {
        flex-direction: column;
        gap: 30px;
    }
}

@media (max-width: 576px) {
    .hero-buttons {
        flex-direction: column;
    }
    
    .section-header h2 {
        font-size: 26px;
    }
    
    .feature-card {
        padding: 20px;
    }
}

/* Pagination */
.pagination {
    margin: 20px 0;
    text-align: center;
}
.pagination .page-number {
    display: inline-block;
    margin: 0 5px;
    padding: 5px 10px;
    background: var(--light-bg);
    color: var(--text-dark);
    cursor: pointer;
    border-radius: 4px;
}
.pagination .page-number.active {
    font-weight: bold;
    background: var(--primary-color);
    color: #fff;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.6);
}
.modal-content {
    background-color: var(--card-bg);
    color: var(--text-dark);
    margin: 10% auto;
    padding: 20px;
    border-radius: 8px;
    width: 80%;
    max-width: 600px;
    position: relative;
}
.modal .close {
    color: #aaa;
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}
.modal .close:hover, .modal .close:focus {
    color: #000;
}

/* Loading spinner */
.spinner {
    border: 8px solid rgba(0,0,0,0.1);
    border-top: 8px solid var(--primary-color);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Stretch content sections to push footer to bottom */
section.section-content {
    flex: 1;
}
