/* Popular Names Gender Filter Styles */
.popular-filters-container {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 15px;
    padding: 2rem;
    margin: 2rem 0;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.popular-filters-container .gender-filter {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.popular-filters-container .filter-label {
    color: white;
    font-size: 1.2rem;
    font-weight: 600;
    margin-right: 1rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.gender-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.4);
    color: white;
    padding: 12px 25px;
    margin: 0 5px;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 16px;
    font-weight: 600;
    backdrop-filter: blur(5px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.gender-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.6);
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
}

.gender-btn.active {
    background: #fff;
    color: #667eea;
    border-color: #fff;
    font-weight: 700;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.25);
    transform: translateY(-2px);
}

/* Responsive design for popular gender filter */
@media (max-width: 768px) {
    .popular-filters-container {
        padding: 1.5rem;
    }
    
    .popular-filters-container .gender-filter {
        flex-direction: column;
        gap: 1rem;
    }
    
    .popular-filters-container .filter-label {
        margin-right: 0;
        margin-bottom: 0.5rem;
        font-size: 1.1rem;
    }
    
    .gender-btn {
        padding: 10px 20px;
        font-size: 15px;
        margin: 3px;
    }
    
    /* Responsive for two-column layout */
    .category-page-container {
        flex-direction: column;
    }
    
    .category-page-sidebar {
        position: static;
        width: 100%;
    }
}

@media (max-width: 480px) {
    .popular-filters-container {
        padding: 1rem;
    }
    
    .popular-filters-container .filter-label {
        font-size: 1rem;
    }
    
    .gender-btn {
        padding: 8px 16px;
        font-size: 14px;
        width: 100%;
        max-width: 200px;
    }
}

/* Container Styles */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Two-column layout for category pages */
.category-page-container {
    display: flex;
    gap: 2rem;
    margin: 2rem 0;
}

.category-page-main {
    flex: 3;
}

.category-page-sidebar {
    flex: 1;
    background-color: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    height: fit-content;
    position: sticky;
    top: 80px;
}

.sidebar-title {
    margin-top: 0;
    margin-bottom: 1rem;
    color: #333;
    font-size: 1.2rem;
}

.alphabet-filter-rail {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.alphabet-btn-rail {
    background-color: #e9ecef;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 0.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.alphabet-btn-rail:hover,
.alphabet-btn-rail.active {
    background-color: #007bff;
    color: white;
    border-color: #007bff;
}

/* Header and Navigation Styles */
.top-header {
    background-color: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    overflow: visible; /* Ensure dropdowns are not clipped */
}

.top-header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.top-site-name-link {
    font-size: 1.5rem;
    font-weight: bold;
    color: #333;
    text-decoration: none;
}

.search-container {
    display: flex;
    align-items: center;
}

.search-input {
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px 0 0 4px;
    font-size: 1rem;
    width: 250px;
}

.go-btn {
    padding: 0.5rem 1rem;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    font-size: 1rem;
}

.go-btn:hover {
    background-color: #0056b3;
}

.header {
    background-color: #007BFF;
    color: white;
    padding: 1rem 0;
    overflow: visible; /* Ensure dropdowns are not clipped */
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-menu {
    display: flex;
    align-items: center;
}

.nav-link {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    margin: 0 0.25rem;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.nav-dropdown {
    position: relative;
}

.desktop-subcategory-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: white;
    color: #333;
    min-width: 200px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
    z-index: 1001; /* Increased z-index to ensure it appears above header */
    border-radius: 4px;
    padding: 0.5rem 0; /* Add padding to improve appearance */
    margin-top: 0; /* Remove any default margin */
    animation: fadeIn 0.3s ease-in-out; /* Add fade in animation */
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.subcategory-link {
    display: block;
    padding: 0.75rem 1rem;
    color: #333;
    text-decoration: none;
    transition: background-color 0.3s;
    border-bottom: 1px solid #eee;
}

.subcategory-link:hover {
    background-color: #f8f9fa;
}

.subcategory-link:last-child {
    border-bottom: none;
}

/* Specific styles for dropdown menus to ensure they're visible */
.nav-dropdown .desktop-subcategory-menu {
    background-color: white;
    border: 1px solid #ddd;
}

/* Mobile Menu */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 2500;
    position: relative;
}

.hamburger-line {
    width: 25px;
    height: 3px;
    background-color: white;
    margin: 3px 0;
    transition: 0.3s;
    border-radius: 2px;
}

.mobile-menu-btn.active .hamburger-line:nth-child(1) {
    transform: rotate(-45deg) translate(-5px, 6px);
}

.mobile-menu-btn.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.mobile-menu-btn.active .hamburger-line:nth-child(3) {
    transform: rotate(45deg) translate(-5px, -6px);
}

.mobile-sidebar {
    position: fixed;
    top: 0;
    left: -300px;
    width: 300px;
    height: 100%;
    background-color: white;
    box-shadow: 2px 0 5px rgba(0,0,0,0.1);
    z-index: 1100;
    transition: left 0.3s ease;
    overflow-y: auto;
}

.mobile-sidebar.active {
    left: 0;
}

.mobile-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    z-index: 1050;
    display: none;
}

.mobile-overlay.active {
    display: block;
}

.sidebar-header {
    background-color: #007BFF;
    color: white;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.close-sidebar {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
}

.mobile-nav-links {
    padding: 1rem;
}

.mobile-nav-link {
    display: block;
    padding: 1rem;
    color: #333;
    text-decoration: none;
    border-bottom: 1px solid #eee;
}

.mobile-nav-link:hover {
    background-color: #f8f9fa;
}

.mobile-subcategory-menu {
    padding-left: 1rem;
    display: none;
}

.mobile-subcategory-menu.active {
    display: block;
}

.premium-link {
    background: linear-gradient(135deg, #ffd700, #ffa500);
    color: #333 !important;
    font-weight: bold;
    border-radius: 4px;
    margin: 0.5rem 0;
}

.premium-badge {
    background-color: #ff6b6b;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    margin-right: 0.5rem;
}

/* Main Content */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* Hero Section */
.hero-section {
    text-align: center;
    padding: 3rem 1rem;
    color: white;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.hero-section h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.hero-section p {
    font-size: 1.2rem;
    max-width: 800px;
    margin: 0 auto;
}

/* Alphabet Filter */
.alphabet-filter-section {
    margin-bottom: 2rem;
}

.alphabet-filter-container {
    background-color: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
}

.alphabet-filter-container h3 {
    margin-top: 0;
    margin-bottom: 1rem;
    color: #333;
}

.alphabet-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
}

.alphabet-btn {
    background-color: #e9ecef;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 0.5rem 1rem;
    cursor: pointer;
    transition: all 0.3s;
}

.alphabet-btn:hover,
.alphabet-btn.active {
    background-color: #007bff;
    color: white;
    border-color: #007bff;
}

/* Results Section */
.results-section {
    margin-bottom: 2rem;
}

.results-container h3 {
    margin-top: 0;
    margin-bottom: 1rem;
    color: #333;
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2rem;
}

.pagination-btn {
    padding: 0.5rem 1rem;
    border: 1px solid #ddd;
    background-color: white;
    cursor: pointer;
    transition: all 0.3s;
}

.pagination-btn:hover,
.pagination-btn.active {
    background-color: #007bff;
    color: white;
    border-color: #007bff;
}

/* Name Meaning Analyzer */
.analyzer-section {
    background-color: #f8f9fa;
    padding: 2rem 1rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    text-align: center;
}

.analyzer-section h1 {
    margin-top: 0;
    margin-bottom: 1rem;
    color: #333;
}

.analyzer-container {
    display: flex;
    max-width: 500px;
    margin: 0 auto 1rem;
}

.analyzer-input {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px 0 0 4px;
    font-size: 1rem;
}

.analyze-button {
    padding: 0.75rem 1.5rem;
    background-color: #28a745;
    color: white;
    border: none;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s;
}

.analyze-button:hover {
    background-color: #218838;
}

.analysis-result {
    max-width: 600px;
    margin: 0 auto;
    text-align: left;
}

/* Popup Styles */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.popup-content {
    background-color: white;
    border-radius: 8px;
    padding: 2rem;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

.close-popup,
.close-account,
.close-contact {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 1.5rem;
    cursor: pointer;
    color: #333;
}

/* Auth Forms */
.auth-form {
    text-align: left;
}

.auth-form h2 {
    text-align: center;
    margin-bottom: 1rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

/* Category Page Image Styles */
.header-image-section {
    margin-bottom: 2rem;
}

.header-image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
    padding: 1rem;
}

.header-image-card {
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.header-image-card:hover {
    transform: scale(1.02);
}

.header-image-card img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    display: block;
}

.header-image-card.active {
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

/* Image wrapper for intro images */
.image-wrapper {
    float: right;
    margin: 0 0 1rem 1rem;
    max-width: 300px;
    width: 100%;
}

.intro-image {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    max-width: 300px;
    height: auto;
}

/* Origin Description */
.origin-description {
    margin-bottom: 2rem;
}

.origin-description h2 {
    text-align: center;
    margin-bottom: 1.5rem;
    color: #333;
}

.intro-content {
    line-height: 1.6;
}

.intro-content p {
    margin-bottom: 1rem;
}

/* Search Section */
.search-section {
    margin-bottom: 2rem;
}

.filter-container {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: end;
    padding: 1.5rem;
    border-radius: 8px;
}

.filter-group {
    display: flex;
    flex-direction: column;
}

.filter-group label {
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.filter-select {
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    min-width: 150px;
}

.search-button {
    padding: 0.75rem 1.5rem;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s;
    height: fit-content;
}

.search-button:hover {
    background-color: #0056b3;
}

/* Popular Names Section */
.popular-names {
    margin: 3rem 0;
}

.popular-names h2 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 2rem;
    color: #333;
}

.names-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.name-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
    text-align: center;
    transition: transform 0.3s, box-shadow 0.3s;
}

.name-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.name-card h3 {
    margin-top: 0;
    color: #333;
}

.meaning {
    color: #666;
    font-style: italic;
    margin: 0.5rem 0;
}

.origin {
    color: #888;
    font-size: 0.9rem;
    margin: 0.5rem 0;
}

.name-meta {
    font-size: 0.85rem;
    color: #666;
    display: block;
    margin-top: 0.25rem;
}

.admin-btn {
    background-color: #28a745;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 0.5rem 1rem;
    cursor: pointer;
    font-size: 0.9rem;
}

.admin-btn:hover {
    background-color: #218838;
}

/* Trending Names Section */
.trending-names {
    margin: 3rem 0;
}

.trending-names h2 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 2rem;
    color: #333;
}

/* Two-column layout for trending names */
.trending-names-container {
    display: flex;
    gap: 2rem;
    margin-top: 2rem;
}

.names-column {
    flex: 3;
}

.filter-column {
    flex: 1;
}

/* Alphabet Filter Styles */
.alphabet-filter-section {
    background-color: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.alphabet-filter-container h3,
.religion-filter-container h3 {
    margin-top: 0;
    margin-bottom: 1rem;
    color: #333;
}

.alphabet-filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.alphabet-btn {
    background-color: #e9ecef;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 0.5rem 1rem;
    cursor: pointer;
    transition: all 0.3s;
}

.alphabet-btn:hover,
.alphabet-btn.active {
    background-color: #007bff;
    color: white;
    border-color: #007bff;
}

.religion-filter-container {
    background-color: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
}

.filter-select {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.names-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
}

.name-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s;
    cursor: pointer;
}

.name-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.name-item h4 {
    margin: 0;
    color: #333;
}

.name-item .meaning {
    margin: 0.25rem 0;
    font-size: 0.9rem;
}

.name-item .gender {
    background-color: #e9ecef;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* Name Item Actions for Trending Names */
.name-item-actions {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

/* Popup Styles */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.popup-content {
    background-color: white;
    border-radius: 8px;
    padding: 2rem;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

.close-popup {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 1.5rem;
    cursor: pointer;
    color: #333;
}

.popup-details h3 {
    margin-top: 0;
    color: #333;
}

.popup-details p {
    margin: 0.5rem 0;
}

.popup-details .meaning {
    font-style: italic;
    color: #666;
}

.popup-details .origin {
    color: #888;
}

.popup-details .gender {
    display: inline-block;
    background-color: #e9ecef;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 600;
}

.popup-details .religion {
    display: inline-block;
    background-color: #d4edda;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-left: 0.5rem;
}

.popup-actions {
    margin-top: 1.5rem;
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.popup-actions .share-btn,
.popup-actions .download-btn {
    background-color: #17a2b8;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 0.5rem 1rem;
    cursor: pointer;
    font-size: 0.9rem;
}

.popup-actions .share-btn:hover,
.popup-actions .download-btn:hover {
    background-color: #138496;
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-menu {
        display: none;
    }
    
    .mobile-menu-btn {
        display: flex;
    }
    
    .search-input {
        width: 150px;
    }
    
    .hero-section h1 {
        font-size: 2rem;
    }
    
    .hero-section p {
        font-size: 1rem;
    }
    
    .filters {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .alphabet-filter {
        width: 100%;
    }
    
    .alphabet-buttons {
        justify-content: center;
    }
    
    .footer-content {
        flex-direction: column;
    }
    
    .footer-column {
        min-width: 100%;
    }
    
    .footer-bottom {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .filter-container {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-group {
        width: 100%;
    }
    
    .filter-select {
        min-width: auto;
    }
    
    .search-button {
        align-self: center;
    }
    
    .image-wrapper {
        float: none;
        max-width: 100%;
        margin: 0 0 1rem 0;
    }
    
    .header-image-grid {
        grid-template-columns: 1fr;
    }
    
    .header-image-card img {
        height: 200px;
    }
    
    .intro-image {
        max-width: 100%;
    }
    
    /* Set width of name cards to 250px on tablet */
    .names-grid {
        grid-template-columns: repeat(auto-fill, 250px);
        justify-content: center;
    }
    
    /* Set width of name items to 250px on tablet */
    .names-list {
        grid-template-columns: repeat(auto-fill, 250px);
        justify-content: center;
    }
    
    /* Reduce height of name cards on mobile */
    .name-card {
        padding: 1rem;
    }
    
    .name-card h3 {
        font-size: 1.2rem;
        margin-bottom: 0.5rem;
    }
    
    .meaning {
        font-size: 0.9rem;
        margin: 0.25rem 0;
    }
    
    .origin {
        font-size: 0.8rem;
        margin: 0.25rem 0;
    }
    
    /* Keep desktop layout for name items on tablet - show gender and religion to the right */
    .name-item {
        /* Remove flex-direction: column to keep horizontal layout */
        align-items: center;
        gap: 0.5rem;
        padding: 0.75rem;
    }
    
    .name-item h4 {
        font-size: 1.1rem;
    }
    
    .name-item .meaning {
        font-size: 0.85rem;
        margin: 0.1rem 0;
    }
    
    .name-item .gender,
    .name-item .religion {
        font-size: 0.75rem;
        padding: 0.2rem 0.4rem;
    }
    
    .name-item-actions {
        flex-direction: row;
        align-self: flex-end;
    }
    
    /* Reduce padding in popular names section */
    .popular-names {
        margin: 2rem 0;
    }
    
    .popular-names h2,
    .trending-names h2 {
        font-size: 1.5rem;
        margin-bottom: 1.5rem;
    }
    
    .names-grid {
        gap: 1.5rem;
        margin-top: 1.5rem;
    }
    
    /* Reduce padding in trending names section */
    .trending-names {
        margin: 2rem 0;
    }
    
    .trending-names-container {
        gap: 1.5rem;
        margin-top: 1.5rem;
    }
    
    .alphabet-filter-section,
    .religion-filter-container {
        padding: 1rem;
    }
    
    .alphabet-filter-container h3,
    .religion-filter-container h3 {
        margin-bottom: 0.75rem;
        font-size: 1.2rem;
    }
    
    .alphabet-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.9rem;
    }
    
    .filter-select {
        padding: 0.4rem;
        font-size: 0.9rem;
    }
    
    /* Responsive styles for simple counter */
    .counter-number {
        padding: 0.25rem;
        margin: 0 0.1rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .top-header-container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .search-input {
        width: 200px;
    }
    
    .newsletter-form {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .newsletter-form input,
    .newsletter-form button {
        width: 100%;
        border-radius: 4px;
    }
    
    /* Set width of name cards to 250px on mobile */
    .names-grid {
        grid-template-columns: repeat(auto-fill, 250px);
        justify-content: center;
    }
    
    /* Set width of name items to 250px on mobile */
    .names-list {
        grid-template-columns: repeat(auto-fill, 250px);
        justify-content: center;
    }
    
    .analyzer-container {
        flex-direction: column;
    }
    
    .analyzer-input {
        border-radius: 4px;
        margin-bottom: 0.5rem;
    }
    
    .analyze-button {
        border-radius: 4px;
    }
    
    /* Keep desktop layout for name items on mobile - show gender and religion to the right */
    .name-item {
        /* Remove flex-direction: column to keep horizontal layout */
        align-items: center;
        padding: 0.5rem;
        gap: 0.25rem;
    }
    
    .name-item h4 {
        font-size: 1rem;
    }
    
    .name-item .meaning {
        font-size: 0.8rem;
    }
    
    .name-item .gender,
    .name-item .religion {
        font-size: 0.7rem;
        padding: 0.15rem 0.3rem;
    }
    
    /* Reduce margins further on small screens */
    .popular-names,
    .trending-names {
        margin: 1.5rem 0;
    }
    
    .popular-names h2,
    .trending-names h2 {
        font-size: 1.3rem;
        margin-bottom: 1rem;
    }
    
    .names-grid {
        gap: 1rem;
        margin-top: 1rem;
    }
    
    .trending-names-container {
        gap: 1rem;
        margin-top: 1rem;
    }
    
    .alphabet-filter-section,
    .religion-filter-container {
        padding: 0.75rem;
    }
    
    .alphabet-filter-container h3,
    .religion-filter-container h3 {
        margin-bottom: 0.5rem;
        font-size: 1.1rem;
    }
    
    .alphabet-btn {
        padding: 0.3rem 0.6rem;
        font-size: 0.8rem;
    }
    
    .filter-select {
        padding: 0.3rem;
        font-size: 0.8rem;
    }
    
    /* Responsive styles for simple counter on small screens */
    .simple-counter {
        padding: 0.5rem;
    }
    
    .counter-number {
        padding: 0.2rem;
        margin: 0 0.05rem;
        font-size: 0.8rem;
    }
    
    /* Responsive styles for name items on small screens */
    .name-item-actions {
        align-self: stretch;
        justify-content: center;
    }
}

/* Gender Filter Buttons Container */
.gender-filter-buttons {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.gender-filter-buttons .filter-label {
    font-weight: 600;
    color: #333;
    margin-right: 1rem;
}
/* Footer Styles */
.footer {
    background-color: #343a40;
    color: white;
    padding: 2rem 0 1rem;
    margin-top: 2rem;
}

.footer-content {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    margin-bottom: 2rem;
}

.footer-column {
    flex: 1;
    min-width: 250px;
    margin-bottom: 1.5rem;
    padding-right: 1rem;
}

.footer-column h3 {
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 1.2rem;
    color: #667eea;
}

.footer-links {
    list-style: none;
    padding: 0;
}

.footer-link {
    display: block;
    color: #ccc;
    text-decoration: none;
    margin-bottom: 0.5rem;
    transition: color 0.3s;
}

.footer-link:hover {
    color: white;
    text-decoration: underline;
}

.newsletter-form {
    display: flex;
    margin-top: 1rem;
}

.newsletter-form input {
    flex: 1;
    padding: 0.5rem;
    border: none;
    border-radius: 4px 0 0 4px;
}

.newsletter-form button {
    background-color: #667eea;
    color: white;
    border: none;
    border-radius: 0 4px 4px 0;
    padding: 0.5rem 1rem;
    cursor: pointer;
    transition: background-color 0.3s;
}

.newsletter-form button:hover {
    background-color: #5a67d8;
}

.social-icons {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.social-icon {
    display: inline-block;
    width: 40px;
    height: 40px;
    background-color: #495057;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-decoration: none;
    transition: background-color 0.3s;
}

.social-icon:hover {
    background-color: #667eea;
}

.premium-btn {
    background-color: #ff7a18 !important; /* Orange color for premium */
    width: auto !important;
    padding: 0 12px !important;
    font-size: 0.8rem;
    font-weight: bold;
}

.premium-btn:hover {
    background-color: #e56e15 !important;
}

.premium-btn i {
    margin-right: 5px;
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid #495057;
    flex-wrap: wrap;
}

.copyright {
    color: #ccc;
    font-size: 0.9rem;
}

.footer-bottom-links {
    display: flex;
    gap: 1rem;
}

.footer-bottom-link {
    color: #ccc;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s;
}

.footer-bottom-link:hover {
    color: white;
    text-decoration: underline;
}

/* Popup Baby Image Styles */
.popup-baby-image {
    width: 100%;
    max-width: 300px;
    height: auto;
    border-radius: 8px;
    margin: 1rem 0;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-menu {
        display: none;
    }
    
    .mobile-menu-btn {
        display: flex;
    }
    
    .search-input {
        width: 150px;
    }
    
    .hero-section h1 {
        font-size: 2rem;
    }
    
    .hero-section p {
        font-size: 1rem;
    }
    
    .filters {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .alphabet-filter {
        width: 100%;
    }
    
    .alphabet-buttons {
        justify-content: center;
    }
    
    .footer-content {
        flex-direction: column;
    }
    
    .footer-column {
        min-width: 100%;
    }
    
    .footer-bottom {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .filter-container {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-group {
        width: 100%;
    }
    
    .filter-select {
        min-width: auto;
    }
    
    .search-button {
        align-self: center;
    }
    
    .image-wrapper {
        float: none;
        max-width: 100%;
        margin: 0 0 1rem 0;
    }
    
    .header-image-grid {
        grid-template-columns: 1fr;
    }
    
    .header-image-card img {
        height: 200px;
    }
    
    .intro-image {
        max-width: 100%;
    }
    
    /* Responsive styles for name items */
    .name-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .name-item-actions {
        flex-direction: row;
        align-self: flex-end;
    }
    
    /* Responsive styles for simple counter */
    .counter-number {
        padding: 0.25rem;
        margin: 0 0.1rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .top-header-container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .search-input {
        width: 200px;
    }
    
    .newsletter-form {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .newsletter-form input,
    .newsletter-form button {
        width: 100%;
        border-radius: 4px;
    }
    
    .names-grid {
        grid-template-columns: 1fr;
    }
    
    .names-list {
        grid-template-columns: 1fr;
    }
    
    .analyzer-container {
        flex-direction: column;
    }
    
    .analyzer-input {
        border-radius: 4px;
        margin-bottom: 0.5rem;
    }
    
    .analyze-button {
        border-radius: 4px;
    }
    
    /* Responsive styles for simple counter on small screens */
    .simple-counter {
        padding: 0.5rem;
    }
    
    .counter-number {
        padding: 0.2rem;
        margin: 0 0.05rem;
        font-size: 0.8rem;
    }
    
    /* Responsive styles for name items on small screens */
    .name-item-actions {
        align-self: stretch;
        justify-content: center;
    }
}