:root {
    --primary-color: #d63384;
    /* Pinkish color matching reference */
    --secondary-color: #6a11cb;
    --bg-light: #f8f9fa;
    --text-dark: #212529;
}

body {
    font-family: 'Figtree', sans-serif;
    background-color: var(--bg-light);
    color: var(--text-dark);
}

/* Navbar Styling */
.navbar {
    padding: 0.8rem 0;
    background-color: #ffffff;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    z-index: 1050;
    transition: all 0.3s ease;
}

.navbar-brand {
    font-weight: 800;
    font-size: 1.6rem;
    color: var(--primary-color) !important;
    letter-spacing: -0.5px;
}

.nav-link {
    font-weight: 600;
    color: #495057;
    font-size: 0.95rem;
    padding: 0.5rem 1rem !important;
    transition: all 0.2s;
    position: relative;
}

.nav-link:hover {
    color: var(--primary-color);
}

/* Desktop indicator for active link */
@media (min-width: 992px) {
    .nav-link::after {
        content: '';
        position: absolute;
        bottom: 0;
        left: 50%;
        width: 0;
        height: 2px;
        background-color: var(--primary-color);
        transition: all 0.3s ease;
        transform: translateX(-50%);
        opacity: 0;
    }

    .nav-link:hover::after {
        width: 20px;
        opacity: 1;
    }
}

/* Search Bar */
.search-form {
    position: relative;
    max-width: 600px;
    width: 100%;
    z-index: 1;
}

.search-input {
    background-color: #f1f3f5;
    border: 2px solid transparent;
    border-radius: 50px;
    padding: 8px 15px 8px 45px;
    /* Space for icon */
    font-size: 0.95rem;
    transition: all 0.3s ease;
    height: 45px;
}

.search-input:focus {
    background-color: #fff;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(214, 51, 132, 0.1);
}

.search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #adb5bd;
    pointer-events: none;
    font-size: 1rem;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 80px 0;
    text-align: center;
    margin-bottom: 2rem;
}

.section-title {
    position: relative;
    display: inline-block;
    margin-bottom: 40px;
    font-weight: 700;
    color: var(--text-dark);
    font-size: 1.75rem;
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: var(--primary-color);
    margin: 10px auto 0;
    border-radius: 2px;
}

/* Cards */
.category-card {
    background: #fff;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-align: center;
    height: 100%;
    border: 1px solid rgba(0, 0, 0, 0.02);
}

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

.category-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 20px;
    background: rgba(214, 51, 132, 0.1);
    color: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

/* Footer Styling */
.footer {
    background-color: #111827;
    /* Darker modern background */
    color: #d1d5db;
    padding: 60px 0 30px;
    margin-top: 0;

    font-size: 0.95rem;
}

.footer-logo {
    color: #fff;
    font-weight: 800;
    font-size: 1.5rem;
    margin-bottom: 20px;
    display: inline-block;
    text-decoration: none;
}

.footer-logo span {
    color: var(--primary-color);
}

.footer-heading {
    color: #fff;
    font-weight: 700;
    margin-bottom: 25px;
    font-size: 1.1rem;
    position: relative;
}

.footer-heading::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -10px;
    width: 40px;
    height: 3px;
    background-color: var(--primary-color);
    border-radius: 2px;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 12px;
}

.footer-links a {
    color: #9ca3af;
    text-decoration: none;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
}

.footer-links a:hover {
    color: #fff;
    padding-left: 5px;
}

.footer-links a i {
    margin-right: 8px;
    font-size: 0.8rem;
    color: var(--primary-color);
}

.footer-text {
    color: #9ca3af;
    line-height: 1.6;
    margin-bottom: 20px;
}

.social-icons a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.05);
    color: #fff;
    margin-right: 10px;
    transition: all 0.3s;
    text-decoration: none;
}

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

.copyright-area {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 50px;
    padding-top: 25px;
    text-align: center;
    color: #6b7280;
    font-size: 0.85rem;
}

@media (max-width: 767.98px) {
    .footer {
        padding: 40px 0 20px;
        text-align: left;
    }

    .copyright-area {
        margin-top: 30px;
    }
}


/* Mobile Responsive (Offcanvas & Search) */
@media (max-width: 991.98px) {
    /* Navbar Container - Flex Layout */
    .navbar .container {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
    }

    .navbar-brand {
        margin-right: auto;
    }

    /* Mobile Nav Icons Container */
    .mobile-nav-icons {
        gap: 0.25rem;
    }

    /* Mobile Icon Buttons - Same Size */
    .mobile-icon-btn {
        width: 40px !important;
        height: 40px !important;
        padding: 0 !important;
        margin: 0 !important;
        color: var(--text-dark) !important;
        text-decoration: none;
        transition: all 0.2s;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
    }

    .mobile-icon-btn:hover,
    .mobile-icon-btn:focus {
        color: var(--primary-color) !important;
        background-color: rgba(214, 51, 132, 0.1);
        text-decoration: none;
    }

    .mobile-icon-btn i {
        font-size: 1.2rem;
    }

    /* Mobile Avatar Circle */
    .mobile-avatar-circle {
        width: 24px;
        height: 24px;
        border-radius: 50%;
        background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
        color: #fff;
        display: flex;
        align-items: center;
        justify-content: center;
        font-weight: 700;
        font-size: 0.75rem;
        box-shadow: 0 2px 8px rgba(214, 51, 132, 0.3);
        transition: transform 0.2s;
    }

    .mobile-avatar-btn:hover .mobile-avatar-circle {
        transform: scale(1.1);
    }

    /* Mobile Menu Icon (3-bar) */
    .mobile-menu-icon {
        width: 20px;
        height: 16px;
        display: inline-block;
        position: relative;
    }

    .mobile-menu-icon::before,
    .mobile-menu-icon::after,
    .mobile-menu-icon {
        content: '';
        display: block;
        width: 20px;
        height: 2px;
        background-color: var(--text-dark);
        border-radius: 2px;
        transition: all 0.3s ease;
        position: absolute;
    }

    .mobile-menu-icon {
        top: 50%;
        transform: translateY(-50%);
    }

    .mobile-menu-icon::before {
        top: -7px;
    }

    .mobile-menu-icon::after {
        bottom: -7px;
    }

    .mobile-menu-btn:hover .mobile-menu-icon,
    .mobile-menu-btn:hover .mobile-menu-icon::before,
    .mobile-menu-btn:hover .mobile-menu-icon::after {
        background-color: var(--primary-color);
    }

    /* Mobile Search Offcanvas (Top Drawer) - Glass Effect */
    .mobile-search-offcanvas.offcanvas-top {
        height: auto;
        max-height: 100vh;
        border-bottom: none;
        z-index: 1065 !important;
        background: rgba(255, 255, 255, 0.85) !important;
        backdrop-filter: blur(20px) saturate(180%);
        -webkit-backdrop-filter: blur(20px) saturate(180%);
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    }

    #mobileSearchOffcanvas {
        z-index: 1065 !important;
        background: rgba(255, 255, 255, 0.85) !important;
        backdrop-filter: blur(20px) saturate(180%);
        -webkit-backdrop-filter: blur(20px) saturate(180%);
    }

    .mobile-search-offcanvas .offcanvas-header {
        padding: 1rem 1.5rem;
        border-bottom: 1px solid rgba(0, 0, 0, 0.1);
        background: transparent;
    }

    .mobile-search-offcanvas .offcanvas-body {
        padding: 1rem 1.5rem 1.5rem 1.5rem;
        position: relative;
        background: transparent;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
    }

    .mobile-search-offcanvas .mobile-search-wrapper {
        margin-top: 0;
        margin-bottom: 1rem;
    }

    /* Centered Search Placeholder */
    .mobile-search-placeholder {
        opacity: 0.5;
        margin-top: 2rem;
        padding: 2rem 1rem;
    }

    .mobile-search-placeholder i {
        color: var(--primary-color);
        opacity: 0.5;
    }

    .mobile-search-placeholder p {
        color: #6c757d;
        margin: 0;
    }

    /* Hide placeholder when user types or results show */
    #mobileSearchOffcanvas .mobile-search-wrapper:has(input:focus) ~ .mobile-search-placeholder,
    #mobileSearchOffcanvas .mobile-search-wrapper:has(input:not([value=""])) ~ .mobile-search-placeholder,
    #mobileSearchOffcanvas .search-autocomplete-dropdown:not([style*="display: none"]) ~ .mobile-search-placeholder {
        display: none;
    }

    /* Ensure search dropdown appears above backdrop with glass effect */
    #mobileSearchOffcanvas .search-autocomplete-dropdown {
        z-index: 1075 !important;
        position: absolute !important;
        background: rgba(255, 255, 255, 0.95) !important;
        backdrop-filter: blur(10px) saturate(180%);
        -webkit-backdrop-filter: blur(10px) saturate(180%);
        border: 1px solid rgba(255, 255, 255, 0.3);
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    }

    /* Offcanvas backdrop - must be below all offcanvas menus */
    .offcanvas-backdrop {
        z-index: 1055 !important;
    }

    /* Offcanvas Menu Styling */
    .offcanvas-end {
        width: 90%;
        max-width: 400px;
        border-left: none;
        box-shadow: -5px 0 30px rgba(0, 0, 0, 0.1);
        background-color: #ffffff;
        z-index: 1060 !important;
    }

    #navbarOffcanvas {
        z-index: 1060 !important;
    }

    .offcanvas-header {
        padding: 1rem 1.5rem;
        background-color: #f8f9fa;
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    }

    .offcanvas-title {
        font-size: 1.4rem;
        letter-spacing: -0.5px;
        color: var(--primary-color);
    }

    .offcanvas-body {
        padding: 0.75rem 1.5rem 1.5rem 1.5rem;
        overflow-x: hidden;
        overflow-y: auto;
    }

    /* Remove top margin from first menu item */
    .offcanvas-body .mobile-nav {
        margin-top: 0;
        padding-top: 0;
        padding-right: 0 !important;
        justify-content: flex-start !important;
        align-items: flex-start !important;
        width: 100%;
    }

    .offcanvas-body .mobile-nav .nav-item:first-child {
        margin-top: 0;
    }

    /* Mobile Nav Links */
    .mobile-nav .nav-link {
        padding: 12px 15px !important;
        border-radius: 10px;
        transition: all 0.2s;
        margin-bottom: 8px;
        font-size: 1rem;
        color: #343a40;
        display: flex;
        align-items: center;
        border: 1px solid transparent;
    }

    /* Mobile Nav Buttons - Full Width */
    .mobile-nav .nav-item .btn {
        width: 100% !important;
        max-width: 100% !important;
        display: block !important;
    }

    .mobile-nav .nav-item {
        width: 100%;
    }

    /* Icons in mobile menu */
    .mobile-nav .nav-link i {
        width: 32px;
        height: 32px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        background-color: #f1f3f5;
        border-radius: 8px;
        margin-right: 12px;
        color: var(--primary-color);
        font-size: 0.9rem;
        transition: all 0.2s ease;
    }

    /* Hover & Active States */
    .mobile-nav .nav-link:hover,
    .mobile-nav .nav-link.active {
        background-color: #fff;
        border-color: #e9ecef;
        color: var(--primary-color);
        transform: translateX(5px);
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.03);
    }

    .mobile-nav .nav-link:hover i,
    .mobile-nav .nav-link.active i {
        background: linear-gradient(135deg, var(--secondary-color) 0%, var(--primary-color) 100%);
        color: white;
    }

    /* Dropdown inside Mobile Menu */
    .mobile-nav .dropdown-menu {
        border: none;
        padding: 0;
        margin: 5px 0 15px 45px;
        /* Indent to align with text */
        background: transparent !important;
        box-shadow: none !important;
        position: static !important;
        transform: none !important;
        border-left: 2px solid #f1f3f5;
    }

    .mobile-nav .dropdown-item {
        padding: 8px 15px;
        border-radius: 6px;
        color: #6c757d;
        font-size: 0.95rem;
        margin-bottom: 2px;
    }

    .mobile-nav .dropdown-item:hover {
        background-color: rgba(214, 51, 132, 0.05);
        color: var(--primary-color);
        padding-left: 20px;
    }

    /* Mobile Search Wrapper */
    .mobile-search-wrapper {
        background: white;
        padding: 5px;
        border-radius: 50px;
        box-shadow: 0 0 0 1px #e9ecef;
        margin-bottom: 25px !important;
        position: relative;
        z-index: 10;
    }

    .mobile-search-wrapper .search-input {
        background: transparent;
        height: 40px;
        border: none;
        font-size: 0.95rem;
        padding-left: 40px;
    }

    .mobile-search-wrapper .search-icon {
        left: 15px;
        font-size: 1rem;
        color: #adb5bd;
    }

    .mobile-search-wrapper:focus-within {
        box-shadow: 0 0 0 2px var(--primary-color);
    }

    .mobile-search-wrapper:focus-within .search-icon {
        color: var(--primary-color);
    }

    /* Hide desktop search specifics if any leak */
    .desktop-search {
        display: none !important;
    }
}

/* Additional utility styles */
.search-input {
    min-width: 200px;
}

.btn-login {
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--primary-color) 100%);
    border: none;
}

.footer .form-control {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
}

.footer .btn-primary {
    background-color: var(--primary-color);
    border: none;
}

.copyright-area a {
    color: var(--secondary-color);
    font-weight: 600;
}

/* Search Autocomplete Dropdown */
.search-autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    width: 380px;
    max-width: calc(100vw - 30px);
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    margin-top: 8px;
    max-height: 500px;
    overflow-y: auto;
    z-index: 1051;
    animation: fadeInDown 0.2s ease;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.search-autocomplete-results {
    padding: 8px 0;
}

.autocomplete-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    border-bottom: 1px solid #f1f3f5;
    text-decoration: none;
    color: inherit;
}

.autocomplete-item:last-child {
    border-bottom: none;
}

.autocomplete-item:hover,
.autocomplete-item.active {
    background-color: #f8f9fa;
}

.autocomplete-see-all {
    padding: 12px 16px;
    border-top: 2px solid #f1f3f5;
    background-color: #f8f9fa;
    border-radius: 0 0 12px 12px;
}

.autocomplete-see-all a {
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.2s ease;
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--primary-color) 100%);
    color: #fff;
    border: none;
    font-weight: 600;
    border-radius: 8px;
}

.autocomplete-see-all a:hover,
.autocomplete-see-all a.active {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(214, 51, 132, 0.3);
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
}

.autocomplete-item-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(214, 51, 132, 0.1);
    border-radius: 8px;
    margin-right: 12px;
    flex-shrink: 0;
    color: var(--primary-color);
    font-size: 0.9rem;
}

.autocomplete-item-content {
    flex: 1;
    min-width: 0;
}

.autocomplete-item-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: #212529;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.autocomplete-item-excerpt {
    font-size: 0.85rem;
    color: #6c757d;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.autocomplete-item-type {
    margin-left: 12px;
    flex-shrink: 0;
}

.autocomplete-item-type .badge {
    font-size: 0.75rem;
    padding: 4px 8px;
    font-weight: 500;
}

.search-autocomplete-loading {
    padding: 20px;
    text-align: center;
}

/* Mobile Responsive */
@media (max-width: 991.98px) {
    /* Mobile search dropdown - positioned relative to search wrapper */
    .mobile-search-wrapper .search-autocomplete-dropdown,
    .search-autocomplete-dropdown {
        position: absolute !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        margin-top: 8px !important;
        transform: none !important;
        z-index: 1060 !important;
        top: 100% !important;
        max-height: 60vh;
        overflow-y: auto;
    }

    /* Mobile Search Offcanvas - ensure dropdown is above backdrop */
    #mobileSearchOffcanvas .mobile-search-wrapper {
        position: relative;
        width: 100%;
    }

    #mobileSearchOffcanvas .search-form {
        width: 100%;
        max-width: 100%;
    }

    #mobileSearchOffcanvas .search-input {
        width: 100% !important;
        max-width: 100% !important;
    }

    #mobileSearchOffcanvas .search-autocomplete-dropdown {
        max-height: calc(100vh - 200px);
        z-index: 1075 !important;
        position: absolute !important;
        background: rgba(255, 255, 255, 0.95) !important;
        backdrop-filter: blur(10px) saturate(180%);
        -webkit-backdrop-filter: blur(10px) saturate(180%);
        border: 1px solid rgba(255, 255, 255, 0.3);
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
        width: 100% !important;
        left: 0 !important;
        right: 0 !important;
    }

    .autocomplete-item {
        padding: 10px 12px;
    }

    .autocomplete-item-icon {
        width: 28px;
        height: 28px;
        font-size: 0.8rem;
        margin-right: 10px;
    }

    .autocomplete-item-title {
        font-size: 0.9rem;
    }

    .autocomplete-item-excerpt {
        font-size: 0.8rem;
        -webkit-line-clamp: 1;
        line-clamp: 1;
        -webkit-box-orient: vertical;
        display: -webkit-box;
        overflow: hidden;
    }

    .autocomplete-item-type .badge {
        font-size: 0.7rem;
        padding: 3px 6px;
    }

    .autocomplete-see-all {
        padding: 10px 12px;
    }

    .autocomplete-see-all a {
        font-size: 0.9rem;
        padding: 8px 16px;
    }
}

/* Pagination Styles */
.pagination-wrapper {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 10px 0;
}

.pagination-wrapper::-webkit-scrollbar {
    height: 4px;
}

.pagination-wrapper::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.pagination-wrapper::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 10px;
}

.pagination {
    justify-content: center;
    flex-wrap: wrap;
    margin: 0;
}

.page-link {
    color: var(--primary-color);
    border: none;
    margin: 0 5px;
    border-radius: 50% !important;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.page-item.active .page-link {
    background-color: var(--primary-color);
    color: white;
}

.page-link:focus {
    box-shadow: 0 0 0 0.25rem rgba(214, 51, 132, 0.25);
}

.page-item.disabled .page-link {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-link:hover {
    background-color: rgba(214, 51, 132, 0.1);
    color: var(--primary-color);
    transform: translateY(-2px);
}

@media (max-width: 768px) {
    .pagination {
        flex-wrap: wrap;
        gap: 5px;
        padding: 0 10px;
    }

    .page-link {
        width: 36px;
        height: 36px;
        font-size: 0.85rem;
        margin: 0 2px;
    }

    .page-item:first-child .page-link,
    .page-item:last-child .page-link {
        padding: 0.375rem 0.5rem;
        width: auto;
        min-width: 36px;
        font-size: 0.85rem;
    }

    .pagination .page-item {
        margin: 0;
    }
}

@media (max-width: 576px) {
    .pagination-wrapper {
        padding: 5px 0;
    }

    .pagination {
        gap: 3px;
        padding: 0 5px;
        justify-content: flex-start;
        min-width: max-content;
    }

    .page-link {
        width: 32px;
        height: 32px;
        font-size: 0.8rem;
        margin: 0 1px;
    }

    .page-item:first-child .page-link,
    .page-item:last-child .page-link {
        padding: 0.25rem 0.4rem;
        min-width: 32px;
        font-size: 0.75rem;
    }
}