/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', sans-serif;
    background-color: #fff;
    color: #333;
    transition: background-color 0.3s, color 0.3s;
}

body.dark-mode {
    background-color: #0F0F23;
    color: #fff;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
header {
    background-color: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.dark-mode header {
    background-color: #1a1a2e;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
}

.logo a {
    font-family: 'Poppins', sans-serif;
    font-size: 1.8rem;
    font-weight: 700;
    color: #FF6B6B;
    text-decoration: none;
}

.nav-links {
    display: flex;
    list-style: none;
}

.nav-links li {
    margin-left: 20px;
    position: relative;
}

.nav-links a {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    padding: 5px 10px;
    border-radius: 5px;
    transition: background-color 0.3s;
}

.dark-mode .nav-links a {
    color: #fff;
}

.nav-links a:hover {
    background-color: #f0f0f0;
}

.dark-mode .nav-links a:hover {
    background-color: #333;
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: #fff;
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
    border-radius: 5px;
    z-index: 1;
    min-width: 150px;
}

.dark-mode .dropdown-content {
    background-color: #1a1a2e;
}

.dropdown:hover .dropdown-content {
    display: block;
}

.dropdown-content a {
    display: block;
    padding: 10px;
    text-decoration: none;
    color: #333;
}

.dark-mode .dropdown-content a {
    color: #fff;
}

.dropdown-content a:hover {
    background-color: #f0f0f0;
}

.dark-mode .dropdown-content a:hover {
    background-color: #333;
}

.header-right {
    display: flex;
    align-items: center;
}

.search-form {
    display: flex;
    margin-right: 15px;
}

.search-form input {
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 5px 0 0 5px;
    outline: none;
}

.dark-mode .search-form input {
    background-color: #333;
    color: #fff;
    border-color: #555;
}

.search-form button {
    padding: 8px 12px;
    background-color: #4ECDC4;
    border: none;
    border-radius: 0 5px 5px 0;
    cursor: pointer;
}

.theme-toggle {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px;
}

/* Hero */
.hero {
    text-align: center;
    padding: 40px 0;
}

.hero h1 {
    font-family: 'Poppins', sans-serif;
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.hero p {
    font-size: 1.2rem;
    color: #666;
}

.dark-mode .hero p {
    color: #aaa;
}

/* Meme Gallery */
.meme-gallery {
    padding: 20px 0;
}

.meme-gallery h2 {
    margin-bottom: 20px;
    font-family: 'Poppins', sans-serif;
}

.meme-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.meme-card {
    background-color: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s;
}

.dark-mode .meme-card {
    background-color: #1a1a2e;
}

.meme-card:hover {
    transform: translateY(-5px);
}

.meme-card img {
    width: 100%;
    height: auto;
    display: block;
}

.meme-info {
    padding: 15px;
}

.meme-info h3 {
    margin-bottom: 10px;
    font-family: 'Poppins', sans-serif;
}

.meme-info h3 a {
    text-decoration: none;
    color: inherit;
}

.meme-info h3 a:hover {
    color: #FF6B6B;
}

.stats {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    color: #777;
}

.dark-mode .stats {
    color: #aaa;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.tag {
    background-color: #f0f0f0;
    padding: 3px 8px;
    border-radius: 15px;
    font-size: 0.8rem;
    text-decoration: none;
    color: #333;
}

.dark-mode .tag {
    background-color: #333;
    color: #fff;
}

.tag:hover {
    background-color: #ddd;
}

.dark-mode .tag:hover {
    background-color: #444;
}

.load-more {
    display: block;
    margin: 30px auto;
    padding: 12px 30px;
    background-color: #FF6B6B;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s;
}

.load-more:hover {
    background-color: #ff5252;
}

/* Ad section */
.ad-section {
    margin: 30px 0;
    text-align: center;
}

.ad-container {
    background-color: #f9f9f9;
    border: 1px dashed #ccc;
    padding: 20px;
    border-radius: 8px;
}

.dark-mode .ad-container {
    background-color: #222;
    border-color: #555;
}

.ad-placeholder {
    width: 300px;
    height: 250px;
    background-color: #e0e0e0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #999;
}

.dark-mode .ad-placeholder {
    background-color: #333;
    color: #666;
}

/* Footer */
footer {
    background-color: #f8f8f8;
    padding: 40px 0 20px;
    margin-top: 50px;
}

.dark-mode footer {
    background-color: #1a1a2e;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.footer-section h3 {
    margin-bottom: 15px;
    font-family: 'Poppins', sans-serif;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 8px;
}

.footer-section a {
    text-decoration: none;
    color: #666;
}

.dark-mode .footer-section a {
    color: #aaa;
}

.footer-section a:hover {
    color: #FF6B6B;
}

.social-links {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.newsletter-form {
    display: flex;
    margin-top: 10px;
}

.newsletter-form input {
    flex: 1;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 5px 0 0 5px;
    outline: none;
}

.dark-mode .newsletter-form input {
    background-color: #333;
    color: #fff;
    border-color: #555;
}

.newsletter-form button {
    padding: 8px 15px;
    background-color: #4ECDC4;
    border: none;
    border-radius: 0 5px 5px 0;
    cursor: pointer;
    color: white;
}

.copyright {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #ddd;
    color: #777;
}

.dark-mode .copyright {
    border-top-color: #333;
    color: #aaa;
}

/* Responsive */
@media (max-width: 768px) {
    header .container {
        flex-direction: column;
    }

    .nav-links {
        margin-top: 15px;
        flex-wrap: wrap;
        justify-content: center;
    }

    .nav-links li {
        margin: 5px;
    }

    .header-right {
        margin-top: 15px;
        width: 100%;
        justify-content: center;
    }

    .search-form {
        flex: 1;
        max-width: 300px;
    }

    .meme-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }

    .footer-grid {
        grid-template-columns: 1fr;
    }
}