/* Base Styles and Variables */
:root {
    --primary-color: #f8f9fa; /* Light background */
    --accent-color: #dc3545; /* Red accent */
    --text-color: #212529; /* Dark text */
    --gold-color: #ffc107; /* Gold for accents */
    --secondary-bg: #e9ecef; /* Light secondary background */
    --light-bg: #ffffff; /* White background */
    --dark-text: #343a40; /* Dark text color */
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --gold-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
    --blue-accent: #4e7ac7; /* Patriotic blue */
}

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

body {
    font-family: 'Arial', sans-serif;
    background-color: var(--primary-color);
    color: var(--dark-text);
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

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

.section-title {
    text-align: center;
    margin: 2rem 0;
    font-size: 2rem;
    color: var(--dark-text);
    text-transform: uppercase;
    position: relative;
    padding-bottom: 0.5rem;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 3px;
    background-color: var(--accent-color);
}

/* Header Styles */
.header {
    background-color: var(--light-bg);
    color: var(--dark-text);
    padding: 1rem;
    position: sticky;
    top: 0;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow);
    border-bottom: 2px solid var(--gold-color);
}

.logo {
    display: flex;
    align-items: center;
}

.logo-icon {
    width: 40px;
    height: 40px;
    margin-right: 10px;
    background-color: var(--blue-accent);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 2px solid var(--gold-color);
    color: var(--light-bg);
    font-weight: bold;
    font-size: 16px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
    position: relative;
    overflow: hidden;
}

.logo-icon::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 30%;
    background-color: var(--accent-color);
}

.logo h1 {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--dark-text);
}

.nav-menu {
    display: flex;
}

.nav-menu li {
    margin-left: 1.5rem;
}

.nav-menu a {
    color: var(--dark-text);
    font-weight: bold;
    padding: 0.5rem 0;
    position: relative;
    transition: color 0.3s;
}

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--gold-color);
    transition: width 0.3s;
}

.nav-menu a:hover,
.nav-menu a.active {
    color: var(--accent-color);
}

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

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--dark-text);
    font-size: 1.5rem;
    cursor: pointer;
}

.search-container {
    position: relative;
}

.search-toggle {
    background: none;
    border: none;
    color: var(--dark-text);
    font-size: 1.2rem;
    cursor: pointer;
}

.search-form {
    display: flex;
    position: absolute;
    right: 0;
    top: 100%;
    background-color: var(--light-bg);
    padding: 0.5rem;
    border-radius: 0 0 4px 4px;
    box-shadow: var(--shadow);
    z-index: 100;
    width: 250px;
    transform: translateY(-10px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.search-form.active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
}

.search-form input {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid var(--gold-color);
    border-radius: 4px 0 0 4px;
    background-color: var(--light-bg);
}

.search-form button {
    background-color: var(--accent-color);
    border: none;
    color: var(--light-bg);
    padding: 0.5rem 1rem;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--blue-accent) 0%, var(--secondary-bg) 100%);
    color: var(--light-bg);
    padding: 3rem 1rem;
    text-align: center;
}

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

.hero-content h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.hero-content p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

/* Meme Card Styles */
.meme-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
}

/* Fixed uniform card sizing */
.meme-card {
    display: flex;
    flex-direction: column;
    width: 100% !important;
    margin-bottom: 30px !important;
    border-radius: 8px !important;
    overflow: hidden !important;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1) !important;
    transition: transform 0.3s ease, box-shadow 0.3s ease !important;
    background-color: var(--light-bg);
    border: 1px solid #ddd;
}

/* Image container with fixed dimensions */
.meme-card .image-container {
    width: 100% !important;
    height: 250px !important; /* Fixed height for all images */
    overflow: hidden !important;
    position: relative !important;
}

/* Image styling for uniform appearance */
.meme-card img {
    width: 100% !important;
    height: 250px !important; /* Fixed height for all images */
    object-fit: cover !important; /* Maintain aspect ratio while filling container */
    object-position: center !important; /* Center the image */
    transition: transform 0.3s ease !important;
    cursor: pointer !important;
}

.meme-card:hover {
    transform: translateY(-5px) !important;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2) !important;
}

.meme-card:hover img {
    transform: scale(1.05) !important;
}

.meme-info {
    padding: 1rem;
}

.meme-caption {
    font-weight: bold;
    margin-bottom: 0.5rem;
    color: var(--dark-text);
}

.meme-actions {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    margin-top: 1rem;
}

/* Improved button layout */
.action-btn {
    flex: 1;
    justify-content: center;
    min-height: 44px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    text-align: center;
    padding: 0.5rem 0.3rem;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
}

.action-btn i {
    margin-right: 4px;
    font-size: 0.9rem;
}

.comment-btn span {
    overflow: hidden;
    text-overflow: ellipsis;
}

.like-btn {
    background-color: #f8f9fa;
    color: #212529;
    border: 1px solid #dee2e6;
}

.like-btn:hover {
    background-color: #f1f3f5;
}

.download-btn {
    background-color: #4e7ac7;
}

.download-btn:hover {
    background-color: #3a67b2;
}

.action-btn {
    background-color: var(--accent-color);
    color: var(--light-bg);
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: background-color 0.3s;
}

.action-btn:hover {
    background-color: #c62d3a;
}

.action-btn.liked {
    background-color: #f8d7da;
    color: #dc3545;
    border: 1px solid #dc3545;
}

.action-btn.liked:hover {
    background-color: #f5c6cb;
}

.action-btn.small {
    padding: 0.3rem 0.7rem;
    font-size: 0.9rem;
}

.action-btn.secondary {
    background-color: var(--blue-accent);
}

.action-btn.secondary:hover {
    background-color: #3a67b2;
}

/* Hashtags */
.hashtags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 1rem 0;
}

.hashtag {
    background-color: var(--secondary-bg);
    color: var(--dark-text);
    padding: 0.3rem 0.7rem;
    border-radius: 20px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: background-color 0.3s;
}

.hashtag:hover {
    background-color: var(--gold-color);
}

/* Comments Section */
.comments-section {
    margin-top: 1rem;
    border-top: 1px solid #ddd;
    padding-top: 1rem;
    animation: fadeIn 0.3s ease;
}

.comments-toggle {
    background: none;
    border: none;
    color: var(--blue-accent);
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0;
    margin-bottom: 1rem;
}

.comments-container {
    display: none;
}

.comments-container.active {
    display: block;
}

.comments-list {
    margin-bottom: 1rem;
    max-height: 300px;
    overflow-y: auto;
}

.comment {
    background-color: var(--secondary-bg);
    padding: 0.8rem;
    border-radius: 8px;
    margin-bottom: 0.8rem;
    animation: slideIn 0.3s ease;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.comment-author {
    font-weight: bold;
    color: var(--dark-text);
}

.comment-date {
    font-size: 0.8rem;
    color: #6c757d;
}

.comment-text {
    line-height: 1.4;
    word-break: break-word;
}

.comment-form {
    margin-top: 1rem;
}

.comment-form textarea {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    resize: vertical;
    min-height: 80px;
    margin-bottom: 0.8rem;
    font-family: inherit;
}

.comment-form button {
    background-color: var(--blue-accent);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.3s;
}

.comment-form button:hover {
    background-color: #3a67b2;
}

.comment-btn {
    background-color: var(--secondary-bg) !important;
    color: var(--dark-text) !important;
}

.comment-btn:hover {
    background-color: #e2e6ea !important;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Categories Section */
.categories {
    padding: 3rem 1rem;
    background-color: var(--secondary-bg);
}

.category-container {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 1.5rem;
    padding: 1rem 0;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
}

.category-container::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Edge */
}

.category-card {
    flex: 0 0 auto;
    width: 200px;
    background-color: var(--light-bg);
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
    box-shadow: var(--shadow);
    border: 1px solid var(--gold-color);
    transition: transform 0.3s, box-shadow 0.3s;
}

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

.category-icon {
    font-size: 2rem;
    color: var(--accent-color);
    margin-bottom: 1rem;
}

.category-card h3 {
    color: var(--dark-text);
    margin-bottom: 0.5rem;
}

.category-card p {
    color: var(--dark-text);
    font-size: 0.9rem;
}

/* Meme of the Day Section */
.meme-of-day {
    padding: 3rem 1rem;
    background-color: var(--blue-accent);
    color: var(--light-bg);
}

.meme-day-header {
    position: relative;
}

.meme-day-header .section-title {
    color: var(--light-bg);
}

.star-banner {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 10px;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23FFD700"><path d="M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z"/></svg>');
    background-repeat: repeat-x;
    background-size: contain;
    opacity: 0.5;
}

.featured-meme {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    background-color: var(--light-bg);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.gold-frame {
    padding: 10px;
    background: linear-gradient(45deg, var(--gold-color), #f5deb3, var(--gold-color));
}

.meme-details {
    padding: 1.5rem;
    background-color: var(--blue-accent);
}

.meme-details h3 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    text-align: center;
    color: var(--light-bg);
}

.meme-stats {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.meme-stats span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.share-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.share-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--light-bg);
    font-size: 1.2rem;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
}

.share-btn:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}

.facebook {
    background-color: #3b5998;
}

.twitter {
    background-color: #1da1f2;
}

.instagram {
    background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
}

.whatsapp {
    background-color: #25d366;
}

/* Upload Section */
.upload-section {
    padding: 3rem 1rem;
    max-width: 800px;
    margin: 0 auto;
}

.upload-container {
    background-color: var(--light-bg);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.upload-area {
    border: 2px dashed var(--blue-accent);
    border-radius: 8px;
    padding: 3rem 1rem;
    text-align: center;
    margin-bottom: 2rem;
    cursor: pointer;
    transition: background-color 0.3s;
}

.upload-area:hover {
    background-color: var(--secondary-bg);
}

.upload-icon {
    font-size: 3rem;
    color: var(--blue-accent);
    margin-bottom: 1rem;
}

.upload-form {
    max-width: 500px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.hashtag-input {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.hashtag-input input {
    flex: 1;
}

.hashtag-input button {
    background-color: var(--blue-accent);
    color: var(--light-bg);
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
}

/* About Section */
.about {
    padding: 3rem 1rem;
    background-color: var(--secondary-bg);
    color: var(--dark-text);
}

.about-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.about-content p {
    margin-bottom: 1rem;
}

/* Footer */
.footer {
    background-color: var(--dark-text);
    color: var(--light-bg);
    padding: 3rem 1rem 1rem;
}

.footer-content {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
    gap: 2rem;
}

.footer-logo h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.footer-links h4,
.footer-social h4 {
    margin-bottom: 1rem;
    position: relative;
    padding-bottom: 0.5rem;
}

.footer-links h4::after,
.footer-social h4::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 2px;
    background-color: var(--accent-color);
}

.footer-links ul {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.footer-links a {
    transition: color 0.3s;
}

.footer-links a:hover {
    color: var(--accent-color);
}

.social-icons {
    display: flex;
    gap: 1rem;
}

.social-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s;
}

.social-icon:hover {
    background-color: var(--accent-color);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    margin-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Mobile Bottom Navigation */
.mobile-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: var(--light-bg);
    border-top: 2px solid var(--gold-color);
    z-index: 1000;
    justify-content: space-around;
    padding: 0.5rem 0;
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--dark-text);
    font-size: 0.8rem;
    padding: 0.5rem;
}

.mobile-nav-item i {
    font-size: 1.2rem;
    margin-bottom: 0.3rem;
}

.mobile-nav-item.active {
    color: var(--accent-color);
}

/* Load More Button */
.load-more-container {
    text-align: center;
    margin: 2rem 0;
}

.load-more {
    background-color: var(--blue-accent);
    color: var(--light-bg);
    border: none;
    padding: 1rem 2rem;
    border-radius: 4px;
    font-weight: bold;
    cursor: pointer;
    font-size: 1.1rem;
    transition: background-color 0.3s;
}

.load-more:hover {
    background-color: #3a67b2;
}

.load-more:disabled {
    background-color: #6c757d;
    cursor: not-allowed;
}

/* All Loaded Message */
.all-loaded-message {
    margin-top: 2rem;
    text-align: center;
    animation: fadeIn 0.5s ease-in;
}

.all-loaded-message p {
    margin-bottom: 1rem;
    font-size: 1.1rem;
    color: var(--dark-text);
}

.upload-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background-color: var(--accent-color);
    color: var(--light-bg);
    padding: 0.8rem 1.5rem;
    border-radius: 4px;
    font-weight: bold;
    transition: all 0.3s;
}

.upload-btn:hover {
    background-color: #c62d3a;
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Return to Home Button */
.return-home {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: var(--blue-accent);
    color: var(--light-bg);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: var(--shadow);
    transition: all 0.3s;
    z-index: 999;
}

.return-home:hover {
    background-color: var(--accent-color);
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.return-home i {
    font-size: 1.5rem;
}

@media (max-width: 768px) {
    .return-home {
        bottom: 70px; /* Adjust for mobile nav */
    }
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .header {
        padding: 0.8rem;
    }

    .logo h1 {
        font-size: 1rem;
    }

    .nav-menu {
        position: fixed;
        top: 60px;
        left: 0;
        width: 100%;
        background-color: var(--light-bg);
        flex-direction: column;
        align-items: center;
        padding: 1rem 0;
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s;
        box-shadow: var(--shadow);
        border-bottom: 2px solid var(--gold-color);
        z-index: 1000;
    }

    .nav-menu.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }

    .nav-menu li {
        margin: 0.5rem 0;
    }

    .menu-toggle {
        display: block;
    }

    .hero-content h2 {
        font-size: 2rem;
    }

    .featured-meme {
        flex-direction: column;
    }

    .meme-details {
        padding: 1rem;
    }

    .meme-stats {
        flex-wrap: wrap;
        gap: 1rem;
    }

    .footer-content {
        flex-direction: column;
        gap: 2rem;
    }

    .footer-links,
    .footer-social {
        width: 100%;
    }
    
    /* Improve touch targets for mobile */
    .action-btn, 
    .share-btn, 
    .nav-menu a {
        padding: 0.7rem 1rem;
        min-height: 44px;
        min-width: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Adjust category scrolling for better mobile experience */
    .category-container {
        padding-bottom: 1rem;
        margin-bottom: 1rem;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x mandatory;
    }
    
    .category-card {
        scroll-snap-align: start;
    }
    
    /* Show mobile navigation */
    .mobile-nav {
        display: flex;
    }
    
    /* Add padding to bottom of page to account for mobile nav */
    body {
        padding-bottom: 60px;
    }
}

@media (max-width: 480px) {
    .section-title {
        font-size: 1.5rem;
    }

    .hero-content h2 {
        font-size: 1.5rem;
    }

    .hero-content p {
        font-size: 1rem;
    }

    .meme-grid {
        grid-template-columns: 1fr;
    }

    .category-card {
        width: 160px;
        padding: 1rem;
    }

    .meme-details h3 {
        font-size: 1.1rem;
    }
    
    /* Further optimize for small screens */
    .meme-actions {
        flex-direction: column;
        gap: 0.5rem;
        align-items: stretch;
    }
    
    .action-btn {
        width: 100%;
        justify-content: center;
    }
    
    .share-buttons {
        flex-wrap: wrap;
        justify-content: space-around;
    }
}

/* Image modal for full-size viewing */
.image-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.image-modal.active {
    display: flex;
}

.modal-content {
    max-width: 90%;
    max-height: 90%;
    position: relative;
}

.modal-content img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 15px;
    color: white;
    font-size: 30px;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    transition: background-color 0.3s;
}

.close-modal:hover {
    background-color: rgba(220, 53, 69, 0.8);
}

/* Trending Page Styles */
.trending-header {
    text-align: center;
    padding: 2rem 1rem;
    max-width: 800px;
    margin: 0 auto;
}

.trending-header h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.trending-header h2 i {
    color: var(--accent-color);
}

.trending-description {
    font-size: 1.1rem;
    color: var(--dark-text);
    margin-bottom: 2rem;
    line-height: 1.6;
}

.trending-filters {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin: 2rem 0;
}

.trending-filter-btn {
    background-color: var(--secondary-bg);
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 30px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.trending-filter-btn:hover {
    background-color: var(--gold-color);
    color: var(--dark-text);
}

.trending-filter-btn.active {
    background-color: var(--accent-color);
    color: white;
}

.trending-stats {
    display: flex;
    justify-content: space-between;
    max-width: 1000px;
    margin: 0 auto 3rem;
    padding: 0 1rem;
}

.stat-card {
    background-color: white;
    border-radius: 10px;
    padding: 2rem;
    text-align: center;
    box-shadow: var(--shadow);
    flex: 1;
    margin: 0 1rem;
    transition: transform 0.3s;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--accent-color);
    margin-bottom: 0.5rem;
}

.stat-label {
    color: var(--dark-text);
    font-weight: bold;
}

.trending-card {
    position: relative;
    overflow: visible;
}

.trending-rank {
    position: absolute;
    top: -15px;
    left: -15px;
    width: 40px;
    height: 40px;
    background-color: var(--gold-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: var(--dark-text);
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    z-index: 2;
}

.trending-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: rgba(0,0,0,0.7);
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    z-index: 2;
}

.meme-title {
    font-size: 1.2rem;
    margin-bottom: 0.8rem;
    color: var(--dark-text);
}

.trending-tag {
    background-color: var(--gold-color);
    color: var(--dark-text);
}

.comment-count {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--dark-text);
}

/* Hashtag Filter Notification */
.hashtag-filter-notification {
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    z-index: 1000;
    display: flex;
    justify-content: center;
    animation: slideDown 0.3s ease-out;
}

.notification-content {
    background-color: var(--blue-accent);
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 15px;
}

.notification-content p {
    margin: 0;
    font-weight: bold;
}

.clear-filter-btn {
    background-color: white;
    color: var(--blue-accent);
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.clear-filter-btn::before {
    content: '←';
    font-size: 1.2em;
}

.clear-filter-btn:hover {
    background-color: #f1f1f1;
    transform: translateX(-3px);
}

@keyframes slideDown {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Device-specific optimizations */
/* iPhone SE / Small devices */
@media (max-width: 375px) {
    .logo h1 {
        font-size: 0.9rem;
    }
    
    .logo-icon {
        width: 30px;
        height: 30px;
        font-size: 14px;
    }
    
    .section-title {
        font-size: 1.3rem;
    }
}

/* Tablet optimization */
@media (min-width: 768px) and (max-width: 1024px) {
    .meme-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .featured-meme {
        flex-direction: column;
    }
}

/* Landscape mode optimization */
@media (max-height: 500px) and (orientation: landscape) {
    .hero {
        padding: 1rem;
    }
    
    .hero-content {
        margin-bottom: 1rem;
    }
    
    .hero-content h2 {
        font-size: 1.5rem;
        margin-bottom: 0.5rem;
    }
    
    .section-title {
        margin: 1rem 0;
    }
}
