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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f8f9fa;
    color: #333;
}

/* Header */
.header {
    background-color: white;
    border-bottom: 1px solid #e5e7eb;
    padding: 0 24px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo {
    width: 40px;
    height: 40px;
}

.logo-circle {
    width: 40px;
    height: 40px;
    background-color: #1f2937;
    color: white;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 16px;
}

.community-name {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 16px;
    color: #1f2937;
    cursor: pointer;
}

.dropdown-arrow {
    color: #6b7280;
}

.nav-menu {
    display: flex;
    gap: 32px;
}

.nav-item {
    text-decoration: none;
    color: #6b7280;
    font-weight: 500;
    font-size: 14px;
    padding: 8px 0;
    border-bottom: 2px solid transparent;
    transition: color 0.2s, border-color 0.2s;
    pointer-events: cursor;
}

.nav-item:hover {
    color: #1f2937;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.search-container {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input {
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 8px 12px 8px 36px;
    font-size: 14px;
    width: 240px;
    background-color: #f9fafb;
    outline: none;
    transition: border-color 0.2s, background-color 0.2s;
}

.search-input:focus {
    border-color: #3b82f6;
    background-color: white;
}

.search-icon {
    position: absolute;
    left: 12px;
    color: #9ca3af;
    z-index: 1;
}

.icon-btn {
    background: none;
    border: none;
    padding: 8px;
    border-radius: 6px;
    color: #6b7280;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s, color 0.2s;
}

.icon-btn:hover {
    background-color: #f3f4f6;
    color: #374151;
}

.profile-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
    cursor: pointer;
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Main Container */
.main-container {
    display: flex;
    margin-top: 64px;
    min-height: calc(100vh - 64px);
}

/* Thin Left Sidebar */
.thin-sidebar {
    width: 64px;
    background-color: white;
    border-right: 1px solid #e5e7eb;
    padding: 16px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    position: fixed;
    left: 0;
    top: 64px;
    height: calc(100vh - 64px);
    z-index: 999;
}

.thin-sidebar-btn {
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    border-radius: 8px;
    color: #6b7280;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.thin-sidebar-btn:hover {
    background-color: #f3f4f6;
    color: #374151;
}

.sparkle-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.sparkle-btn:hover {
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
    color: white;
    transform: scale(1.05);
}

.gamify-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 40px;
            margin-top: -92vh;
            width: 100vw;
            background: white;
            padding: 15px;
            border-bottom: 1px solid #e5e7eb;
        }

        .gamify-header h1 {
            font-size: 24px;
            font-weight: 600;
            color: #2c3e50;
            margin-left: 5vw;
        }

        .gamify-activate-btn {
            background-color: #2c3e50;
            color: white;
            border: none;
            padding: 10px 20px;
            border-radius: 8px;
            font-size: 14px;
            cursor: pointer;
            transition: background-color 0.2s;
        }

        .gamify-activate-btn:hover {
            background-color: #34495e;
        }

        .gamify-hero-section {
            text-align: center;
            margin-bottom: 50px;
        }

        .gamify-hero-section h2 {
            font-size: 36px;
            font-weight: 700;
            color: #2c3e50;
            margin-bottom: 15px;
        }

        .gamify-hero-section p {
            font-size: 18px;
            color: #7f8c8d;
            margin-bottom: 25px;
        }

        .gamify-content-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 30px;
            margin-bottom: 30px;
            width: 75vw;
            margin-left: 13vw;
        }

        .gamify-feature-card {
            border-radius: 16px;
            padding: 30px;
            display: flex;
            gap: 30px;
            align-items: flex-start;
        }

        .gamify-points-section {
            background: linear-gradient(135deg, #fce4ec 0%, #f8bbd9 100%);
        }

        .gamify-levels-section {
            background: linear-gradient(135deg, #e8f5e8 0%, #c8e6c9 100%);
        }

        .gamify-feature-content {
            flex: 1;
        }

        .gamify-feature-icon {
            width: 50px;
            height: 50px;
            border-radius: 12px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 24px;
            margin-bottom: 20px;
        }

        .gamify-points-section .gamify-feature-icon {
            background-color: rgba(233, 30, 99, 0.1);
        }

        .gamify-levels-section .gamify-feature-icon {
            background-color: rgba(76, 175, 80, 0.1);
        }

        .gamify-feature-title {
            font-size: 24px;
            font-weight: 700;
            color: #2c3e50;
            margin-bottom: 15px;
        }

        .gamify-feature-description {
            color: #5d6d7e;
            margin-bottom: 20px;
            line-height: 1.5;
        }

        .gamify-feature-benefits {
            list-style: none;
        }

        .gamify-feature-benefits li {
            display: flex;
            align-items: center;
            gap: 10px;
            margin-bottom: 10px;
            color: #2c3e50;
            font-size: 14px;
        }

        .gamify-feature-benefits li::before {
            content: "✓";
            color: #27ae60;
            font-weight: bold;
            width: 16px;
            height: 16px;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .gamify-dashboard-preview {
            background: white;
            border-radius: 16px;
            padding: 20px;
            box-shadow: 0 4px 20px rgba(0,0,0,0.08);
            min-width: 300px;
        }

        .gamify-level-progress-panel {
            background: white;
            border-radius: 16px;
            padding: 20px;
            box-shadow: 0 4px 20px rgba(0,0,0,0.08);
            margin-bottom: 20px;
        }

        .gamify-user-profile {
            display: flex;
            align-items: center;
            gap: 15px;
            margin-bottom: 20px;
        }

        .gamify-user-avatar {
            width: 50px;
            height: 50px;
            border-radius: 50%;
            background: linear-gradient(45deg, #667eea 0%, #764ba2 100%);
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-weight: bold;
            font-size: 18px;
        }

        .gamify-user-details h3 {
            font-size: 16px;
            font-weight: 600;
            color: #2c3e50;
            margin-bottom: 2px;
        }

        .gamify-user-details p {
            font-size: 14px;
            color: #7f8c8d;
        }

        .gamify-levels-grid {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 15px;
            margin-bottom: 20px;
        }

        .gamify-level-item {
            background: #f8f9fa;
            border-radius: 12px;
            padding: 12px;
            text-align: center;
            border: 2px solid transparent;
            transition: all 0.2s;
        }

        .gamify-level-item.gamify-current-level {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            transform: scale(1.05);
        }

        .gamify-level-number {
            font-size: 14px;
            font-weight: 600;
            margin-bottom: 5px;
        }

        .gamify-level-points {
            font-size: 12px;
            opacity: 0.7;
        }

        .gamify-progress-text {
            text-align: center;
            font-size: 12px;
            color: #7f8c8d;
        }

        .gamify-leaderboard {
            background: white;
            border-radius: 16px;
            padding: 20px;
            box-shadow: 0 4px 20px rgba(0,0,0,0.08);
        }

        .gamify-leaderboard-entry {
            display: flex;
            align-items: center;
            gap: 15px;
            padding: 12px 0;
            border-bottom: 1px solid #f1f3f4;
        }

        .gamify-leaderboard-entry:last-child {
            border-bottom: none;
        }

        .gamify-rank-badge {
            width: 30px;
            height: 30px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: bold;
            font-size: 14px;
        }

        .gamify-rank-badge.gamify-first-place {
            background: linear-gradient(45deg, #f1c40f, #f39c12);
            color: white;
        }

        .gamify-rank-badge.gamify-second-place {
            background: linear-gradient(45deg, #95a5a6, #7f8c8d);
            color: white;
        }

        .gamify-rank-badge.gamify-third-place {
            background: linear-gradient(45deg, #e67e22, #d35400);
            color: white;
        }

        .gamify-rank-badge.gamify-other-rank {
            background: #ecf0f1;
            color: #7f8c8d;
        }

        .gamify-member-avatar {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            background: linear-gradient(45deg, #3498db, #2980b9);
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-weight: bold;
        }

        .gamify-member-details {
            flex: 1;
        }

        .gamify-member-details h4 {
            font-size: 14px;
            font-weight: 600;
            color: #2c3e50;
            margin-bottom: 2px;
        }

        .gamify-member-details p {
            font-size: 12px;
            color: #7f8c8d;
        }

        .gamify-points-total {
            font-size: 14px;
            font-weight: 600;
            color: #2c3e50;
        }

        .gamify-member-profile-card {
            background: white;
            border-radius: 16px;
            padding: 25px;
            box-shadow: 0 4px 20px rgba(0,0,0,0.08);
            text-align: center;
        }

        .gamify-member-profile-card .gamify-user-avatar {
            width: 80px;
            height: 80px;
            margin: 0 auto 15px;
            font-size: 28px;
        }

        .gamify-member-profile-card h3 {
            font-size: 20px;
            font-weight: 700;
            color: #2c3e50;
            margin-bottom: 5px;
        }

        .gamify-member-profile-card p {
            color: #7f8c8d;
            margin-bottom: 15px;
        }

        .gamify-current-level-badge {
            background: linear-gradient(45deg, #667eea, #764ba2);
            color: white;
            padding: 8px 16px;
            border-radius: 20px;
            font-weight: 600;
            font-size: 18px;
            display: inline-block;
        }

        @media (max-width: 768px) {
            .gamify-content-grid {
                grid-template-columns: 1fr;
            }
            
            .gamify-feature-card {
                flex-direction: column;
                text-align: center;
            }
            
            .gamify-levels-grid {
                grid-template-columns: repeat(2, 1fr);
            }
        }


        /* Masonry Layout */
.gamify-masonry {
    columns: 300px 2; /* 2 columns, min-width 300px */
    column-gap: 24px;
    width: 90%;
    margin: 2rem auto;
    margin-left: 7vw;
}

.gamify-masonry-card {
    break-inside: avoid;
    page-break-inside: avoid; /* For Firefox */
    background: white;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
isolation: isolate; /* Creates new stacking context */
    transition: transform 0.2s ease;
}

.gamify-masonry-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    z-index: 10; /* Bring hovered card to front */
}


/* Preserved Gradients */
.gamify-points-section {
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8f0 100%);

}

.gamify-levels-section {
    background: linear-gradient(135deg, #FFD6E0 0%, #FFC3D0 50%, #FFAFBD 100%);

}

/* Enhanced Content Styling */
.gamify-feature-icon {
    font-size: 28px;
    margin-bottom: 16px;
    display: inline-block;
}

.gamify-feature-title {
    font-size: 20px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 12px;
}

.gamify-feature-description {
    color: #4b5563;
    margin-bottom: 16px;
    line-height: 1.5;
}

.gamify-feature-benefits {
    list-style: none;
    padding-left: 0;
}

.gamify-feature-benefits li {
    position: relative;
    padding-left: 24px;
    margin-bottom: 8px;
    color: #374151;
}

.gamify-feature-benefits li:before {
    content: "•";
    color: #667eea;
    font-weight: bold;
    position: absolute;
    left: 0;
}

/* Levels Grid */
.gamify-levels-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.gamify-level-item {
    background: rgba(255,255,255,0.7);
    border-radius: 8px;
    padding: 12px 8px;
    text-align: center;
}

.gamify-current-level {
    background: #3b82f6;
    color: white;
}

.gamify-level-number {
    font-weight: 600;
    font-size: 14px;
}

.gamify-level-points {
    font-size: 12px;
    opacity: 0.8;
}

/* Responsive */
@media (max-width: 768px) {
    .gamify-masonry {
        columns: 1;
        width: 95%;
    }
    
    .gamify-masonry-card {
        margin-bottom: 16px;
    }
}


.gamify-btn {
    background: rgba(255,255,255,0.3);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255,255,255,0.5);
    color: #2c3e50;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.gamify-btn:hover {
    background: rgba(255,255,255,0.5);
    transform: translateX(4px);
}



.gamify-btn:hover::after {
    transform: translateX(3px);
}

@media (max-width: 768px) {
    .gamify-masonry {
        columns: 1;
    }
}

/* New Pattern Styles */
.gamify-hex-fade::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 60%;
    height: 100%;
    background: 
        radial-gradient(circle at 70% 50%, 
            transparent 0%, 
            transparent 10%, 
            rgba(255,255,255,0.15) 10.5%, 
            rgba(255,255,255,0.15) 14%, 
            transparent 14.5%
        ),
        repeating-linear-gradient(
            60deg,
            transparent,
            transparent 15px,
            rgba(255,255,255,0.1) 15px,
            rgba(255,255,255,0.1) 30px
        );
    mask-image: linear-gradient(to left, black 30%, transparent);
    opacity: 0.7;
}

.gamify-diagonal-stripe::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 50%;
    height: 100%;
    background: 
        repeating-linear-gradient(
            -45deg,
            rgba(255,255,255,0.1),
            rgba(255,255,255,0.1) 5px,
            transparent 5px,
            transparent 10px
        );
    mask-image: linear-gradient(to left, black 30%, transparent);
}

.gamify-bubbles::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 50%;
    height: 100%;
    background: 
        radial-gradient(circle at 70% 30%, 
            rgba(255,255,255,0.2) 0%, 
            transparent 20%
        ),
        radial-gradient(circle at 30% 70%, 
            rgba(255,255,255,0.2) 0%, 
            transparent 20%
        );
    mask-image: linear-gradient(to left, black 30%, transparent);
}

.gamify-triangles::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 50%;
    height: 100%;
    background: 
        linear-gradient(325deg, 
            transparent 25%, 
            rgba(255,255,255,0.1) 25%, 
            rgba(255,255,255,0.1) 50%, 
            transparent 50%, 
            transparent 75%, 
            rgba(255,255,255,0.1) 75%
        );
    background-size: 20px 20px;
    mask-image: linear-gradient(to left, black 30%, transparent);
}

.gamify-circuit::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    background:
        linear-gradient(90deg, 
            transparent 20px,
            rgba(255,255,255,0.1) 1%
        ),
        linear-gradient(
            transparent 20px,
            rgba(255,255,255,0.1) 1%
        );
    background-size: 22px 22px;
    background-position: 0 0, 11px 11px;
    mask-image: linear-gradient(to left, black 30%, transparent);
}

.gamify-dot-grid::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 50%;
    height: 100%;
    background: 
        radial-gradient(circle at 1px 1px, 
            rgba(255,255,255,0.2) 1px, 
            transparent 1px
        );
    background-size: 15px 15px;
    mask-image: linear-gradient(to left, black 30%, transparent);
}

.gamify-masonry-card:hover .pattern-layer { opacity: 0.8 !important; }

.gamify-zigzag::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 50%;
    height: 100%;
    background: 
        linear-gradient(135deg,
            transparent 25%,
            rgba(255,255,255,0.2) 25%,
            rgba(255,255,255,0.2) 50%,
            transparent 50%,
            transparent 75%,
            rgba(255,255,255,0.2) 75%
        );
    background-size: 20px 20px;
    mask-image: linear-gradient(to left, black 30%, transparent);
}

.gamify-blobs::before {
    content: "";
    position: absolute;
    top: -50%;
    right: -20%;
    width: 70%;
    height: 200%;
    background: 
        radial-gradient(ellipse at center,
            rgba(255,255,255,0.2) 0%,
            transparent 70%
        ),
        radial-gradient(ellipse at 30% 60%,
            rgba(255,255,255,0.15) 0%,
            transparent 60%
        );
    border-radius: 50%;
    transform: rotate(15deg);
}

/* Fix for Masonry Cards */
.gamify-masonry-card {
    break-inside: avoid;
    position: relative; /* Required for z-index */
    z-index: 1; /* Base z-index */
    transform: translateZ(0); /* Force hardware acceleration */
}

/* Hover Fixes */
.gamify-masonry-card:hover {
    z-index: 100; /* Higher than other cards */
    transform: translateY(-5px) scale(1.02) translateZ(0);
}

/* Pattern Layer Fix */
.gamify-masonry-card::before,
.gamify-masonry-card::after {
    z-index: -1; /* Behind content */
    pointer-events: none; /* Prevent interaction */
}

/* Specific Fix for Right Column Cards */
.gamify-masonry {
    perspective: 1000px; /* Creates 3D space */
}

/* Button Arrow Fix */
.gamify-btn::after {
    display: inline-block;
    transition: transform 0.3s ease;
    margin-left: 5px;
}

.gamify-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal-content {
  width: 90%;
  max-width: 500px;
  background: white;
  border-radius: 16px;
  padding: 30px;
  position: relative;
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.modal-close {
  position: absolute;
  top: 15px;
  right: 15px;
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #6b7280;
}

.modal-body h3 {
  font-size: 22px;
  color: #1f2937;
  margin-bottom: 15px;
  border-bottom: 1px solid #e5e7eb;
  padding-bottom: 10px;
}

.modal-body p {
  color: #4b5563;
  margin-bottom: 20px;
  line-height: 1.6;
}

.modal-body ul {
  list-style: none;
  margin-bottom: 25px;
}

.modal-body li {
  padding: 8px 0;
  position: relative;
  padding-left: 25px;
}

.modal-body li:before {
  content: "•";
  color: #3b82f6;
  font-size: 20px;
  position: absolute;
  left: 5px;
  top: 5px;
}

.modal-cta {
  background: #3b82f6;
  color: white;
  border: none;
  padding: 12px 25px;
  border-radius: 6px;
  font-weight: 500;
  cursor: pointer;
  display: block;
  width: 100%;
  transition: background 0.2s;
}

.modal-cta:hover {
  background: #2563eb;
}

.thin-sidebar-btn {
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    border-radius: 8px;
    color: #6b7280;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.thin-sidebar-btn:hover {
    background-color: #f3f4f6;
    color: #374151;
}