/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header Styles */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 20px;
}

.logo {
    font-size: 2rem;
    font-weight: bold;
    background: linear-gradient(45deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.search-container {
    flex: 1;
    max-width: 500px;
    margin-left: 2rem;
}

.search-form {
    display: flex;
    gap: 0.5rem;
}

.search-input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 2px solid #e1e5e9;
    border-radius: 25px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s ease;
}

.search-input:focus {
    border-color: #667eea;
}

.search-btn {
    padding: 0.75rem 1.5rem;
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.search-btn:hover {
    transform: translateY(-2px);
}

/* Ad Spaces */
.ad-space {
    margin: 2rem 0;
    text-align: center;
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    padding: 2rem;
}

.ad-placeholder {
    color: #6c757d;
    font-size: 1.1rem;
    font-weight: 500;
}

.ad-header {
    margin: 0;
    padding: 1rem;
}

.ad-middle {
    margin: 3rem 0;
}

.ad-bottom {
    margin: 3rem 0 2rem 0;
}

.ad-footer {
    margin: 2rem 0 1rem 0;
    padding: 1rem;
}

/* Main Content */
.main-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    margin: 2rem auto;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.welcome-section {
    text-align: center;
    padding: 3rem 2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.welcome-section h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.welcome-section p {
    font-size: 1.2rem;
    opacity: 0.9;
}

/* Popular Sites Section */
.popular-sites, .news-section {
    padding: 2rem;
}

.popular-sites h3, .news-section h3 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    color: #333;
    text-align: center;
}

.sites-grid, .news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.site-card, .news-card {
    background: white;
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #e9ecef;
}

.site-card:hover, .news-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.site-card h4, .news-card h4 {
    color: #667eea;
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}

.site-card p, .news-card p {
    color: #666;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.site-card a, .news-card a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: color 0.3s ease;
}

.site-card a:hover, .news-card a:hover {
    color: #764ba2;
}

.site-card a::after, .news-card a::after {
    content: '→';
    transition: transform 0.3s ease;
}

.site-card a:hover::after, .news-card a:hover::after {
    transform: translateX(3px);
}

/* Loading State */
.loading {
    text-align: center;
    padding: 3rem;
    color: #666;
    font-size: 1.1rem;
}

.loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #667eea;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Footer */
.footer {
    background: #2c3e50;
    color: white;
    padding: 3rem 0 1rem 0;
    margin-top: 2rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h4 {
    margin-bottom: 1rem;
    color: #ecf0f1;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section ul li a {
    color: #bdc3c7;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section ul li a:hover {
    color: #667eea;
}

.footer-section p {
    color: #bdc3c7;
    line-height: 1.6;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid #34495e;
    color: #bdc3c7;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header .container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .search-container {
        margin-left: 0;
        width: 100%;
    }
    
    .logo {
        font-size: 1.5rem;
    }
    
    .welcome-section h2 {
        font-size: 2rem;
    }
    
    .sites-grid, .news-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
}

/* Search Results Page Styles */
.search-results {
    padding: 2rem;
}

.search-results h2 {
    margin-bottom: 2rem;
    color: #333;
}

.result-item {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border-left: 4px solid #667eea;
}

.result-item h3 {
    color: #667eea;
    margin-bottom: 0.5rem;
}

.result-item p {
    color: #666;
    margin-bottom: 0.5rem;
}

.result-item a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
}

.result-item a:hover {
    text-decoration: underline;
}

/* Search Results Page Styles */
.search-results-header {
    text-align: center;
    padding: 2rem 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    margin: -2rem -2rem 2rem -2rem;
}

.search-results-header h2 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.search-results-header p {
    font-size: 1.2rem;
    opacity: 0.9;
}

.result-link {
    color: #28a745 !important;
    font-size: 0.9rem;
    text-decoration: none;
    display: block;
    margin-top: 0.5rem;
}

.result-link:hover {
    text-decoration: underline;
}

/* Pagination Styles */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin: 2rem 0;
    padding: 1rem;
}

.pagination-btn {
    padding: 0.75rem 1.5rem;
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pagination-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.pagination-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

#pageInfo {
    font-weight: 500;
    color: #333;
    font-size: 1.1rem;
}

/* Error States */
.error {
    background: #f8d7da;
    color: #721c24;
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
    border: 1px solid #f5c6cb;
}

.success {
    background: #d4edda;
    color: #155724;
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
    border: 1px solid #c3e6cb;
}
