/* Categories Page Styles */

:root {
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --primary-gradient: linear-gradient(135deg, #00A651 0%, #007d3d 100%);
    --accent-color: #00A651;
    --text-color: #ffffff;
}

.main-content {
    background: transparent;
    padding: 20px;
    padding-bottom: calc(120px + env(safe-area-inset-bottom));
    z-index: 1;
}

/* Header Section */
.categories-header {
    text-align: left;
    margin-bottom: 30px;
    padding: 10px;
    animation: fadeInDown 0.8s ease-out;
}

.categories-header h2 {
    font-size: 28px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 8px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.categories-header p {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 300;
}

/* Categories Grid */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    animation: fadeInUp 0.8s ease-out;
}

/* Category Card */
.category-card {
    position: relative;
    height: 200px;
    border-radius: 24px;
    overflow: hidden;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-10px);
    }

    100% {
        transform: translateY(0px);
    }
}

.category-card:nth-child(even) {
    animation-delay: 1s;
}

.category-card:hover {
    transform: translateY(-15px) scale(1.05);
    box-shadow: 0 20px 50px rgba(0, 166, 81, 0.4);
    border-color: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(20px);
}

.category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 0.8) 100%);
    z-index: 1;
}

.category-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.category-card:hover .category-image {
    transform: scale(1.1);
}

.category-info {
    position: relative;
    z-index: 2;
    padding: 20px;
    color: #fff;
}

.category-name {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 4px;
    text-transform: capitalize;
}

.category-desc {
    font-size: 11px;
    opacity: 0.8;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}

.category-stats {
    margin-top: 10px;
    font-size: 10px;
    font-weight: 700;
    background: var(--primary-gradient);
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 15px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 15px rgba(0, 166, 81, 0.3);
}

.category-stats::after {
    content: '\f105';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
}

/* Search Overlay */
.search-toggle {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.search-toggle:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.1);
}

.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(15px);
    z-index: 2000;
    display: none;
    flex-direction: column;
    align-items: center;
    padding-top: 100px;
}

.search-overlay.active {
    display: flex;
    animation: fadeIn 0.3s ease;
}

.search-bar {
    width: 90%;
    max-width: 500px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 30px;
    padding: 15px 25px;
    display: flex;
    align-items: center;
    gap: 15px;
    color: #fff;
}

.search-bar input {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 18px;
    width: 100%;
    outline: none;
    font-family: 'Poppins', sans-serif;
}

.search-bar i {
    font-size: 20px;
    opacity: 0.7;
}

#closeSearch {
    cursor: pointer;
    transition: all 0.3s ease;
}

#closeSearch:hover {
    opacity: 1;
    transform: rotate(90deg);
}

/* Skeleton Loading */
.category-skeleton {
    height: 200px;
    border-radius: 24px;
    /* background: linear-gradient(90deg, rgba(255, 255, 255, 0.05) 25%, rgba(255, 255, 255, 0.1) 50%, rgba(255, 255, 255, 0.05) 75%); */
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* No Results */
.no-results {
    text-align: center;
    margin-top: 50px;
    color: rgba(255, 255, 255, 0.6);
}

.no-results i {
    font-size: 50px;
    margin-bottom: 20px;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .categories-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .category-card {
        height: 180px;
    }
}

/* Dark Mode Overrides (if any) */
body.dark-mode .category-card {
    background: rgba(15, 23, 42, 0.4);
    border-color: rgba(255, 255, 255, 0.1);
}

/* --- HANGING MOON (DARK MODE ONLY) --- */
.hanging-moon-container {
    position: absolute;
    top: 100%;
    /* Attach to bottom of nav */
    right: 70px;
    display: none;
    /* Hidden by default */
    flex-direction: column;
    align-items: center;
    z-index: 1001;
    pointer-events: none;
    transform-origin: top center;
    animation: moonSwing 4s ease-in-out infinite;
}

/* Show only in dark mode */
html.dark-mode .hanging-moon-container,
body.dark-mode .hanging-moon-container {
    display: flex;
}

.rope {
    width: 2px;
    height: 35px;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.2));
    box-shadow: 0 0 5px rgba(255, 255, 255, 0.2);
}

.moon {
    width: 32px;
    height: 32px;
    background: radial-gradient(circle at 30% 30%, #fdfcf0, #ebe29d);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 20px rgba(253, 252, 240, 0.4), inset -2px -2px 5px rgba(0, 0, 0, 0.2);
    margin-top: -2px;
}

.moon i {
    font-size: 14px;
    color: #2D3436;
    opacity: 0.3;
}

@keyframes moonSwing {

    0%,
    100% {
        transform: rotate(-5deg);
    }

    50% {
        transform: rotate(5deg);
    }
}

#moonToggle.retracting {
    animation: moonRetract 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards !important;
}

@keyframes moonRetract {
    0% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }

    30% {
        transform: translateY(15px) scale(1.1);
        opacity: 1;
    }

    100% {
        transform: translateY(-150px) scale(0.5);
        opacity: 0;
    }
}