/* app/static/css/components.css */

/* Cards & Containers */
.card {
    background: var(--surface-solid);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
}

.glass-card {
    background: var(--surface);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.glass-card:hover {
    border-color: var(--border-hover);
}

/* Grids */
.grid-2 {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 24px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

@media (max-width: 900px) {
    .grid-2, .grid-3 {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: 14px;
    font-size: 0.95rem;
    font-weight: 600;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-sm {
    padding: 8px 14px;
    font-size: 0.85rem;
    border-radius: 10px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, #4f46e5 100%);
    color: white;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: white;
    border-color: var(--border);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    color: var(--text);
    border-color: var(--border);
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--border-hover);
}

.btn-outline.active {
    background: var(--primary);
    border-color: var(--primary);
}

.btn-success {
    background: linear-gradient(135deg, var(--success) 0%, #059669 100%);
    color: white;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger) 0%, #e11d48 100%);
    color: white;
    box-shadow: 0 4px 14px rgba(244, 63, 94, 0.3);
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(244, 63, 94, 0.4);
}

.btn-block {
    display: flex;
    width: 100%;
}

.btn.disabled, .btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* Icon Button */
.icon-btn {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--border-hover);
}

.icon-btn i {
    width: 20px;
    height: 20px;
}

/* Form Controls */
.form-card {
    max-width: 480px;
    margin: 40px auto;
}

.form-card-wide {
    max-width: 800px;
    margin: 20px auto;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
}

.form-group label {
    font-weight: 600;
    font-size: 0.92rem;
    color: var(--muted);
}

.form-control {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 1rem;
    color: white;
    font-family: inherit;
    transition: all 0.2s ease;
    width: 100%;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

textarea.form-control {
    resize: vertical;
}

.form-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-help {
    font-size: 0.82rem;
    color: var(--muted);
    margin-top: 4px;
}

.uppercase {
    text-transform: uppercase;
}

/* Color Picker */
.color-picker-grid {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 6px;
}

.color-radio {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    position: relative;
    display: block;
    transition: transform 0.2s ease;
    border: 2px solid transparent;
}

.color-radio:hover {
    transform: scale(1.1);
}

.color-radio input {
    opacity: 0;
    position: absolute;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.color-radio:has(input:checked) {
    border-color: white;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.5);
    transform: scale(1.08);
}

/* Custom Checkbox */
.form-group-checkbox {
    margin-bottom: 20px;
}

.checkbox-container {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-weight: 500;
}

.checkbox-container input {
    display: none;
}

.checkbox-checkmark {
    width: 20px;
    height: 20px;
    border-radius: 6px;
    border: 2px solid var(--border);
    display: inline-block;
    position: relative;
    transition: all 0.2s ease;
}

.checkbox-container:hover input ~ .checkbox-checkmark {
    border-color: var(--border-hover);
}

.checkbox-container input:checked ~ .checkbox-checkmark {
    background-color: var(--primary);
    border-color: var(--primary);
}

.checkbox-container input:checked ~ .checkbox-checkmark::after {
    content: '';
    position: absolute;
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Dropdown Menus (General) */
.profile-dropdown, .notification-dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 12px);
    width: 320px;
    background: var(--surface-solid);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.5);
    display: none;
    z-index: 1000;
    animation: slideDown 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.dropdown-menu.show {
    display: block;
}

.dropdown-header {
    padding: 16px 20px;
    font-weight: 700;
    font-size: 0.95rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dropdown-content {
    max-height: 300px;
    overflow-y: auto;
    padding: 8px;
}

.dropdown-footer {
    padding: 12px 16px;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.dropdown-footer a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--muted);
}

.dropdown-footer a:hover {
    background: rgba(255,255,255,0.03);
    color: white;
}

.dropdown-footer a.logout-link:hover {
    background: rgba(244, 63, 94, 0.05);
    color: var(--danger-text);
}

/* Profile Switcher specifics */
.profile-select-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    color: white;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s ease;
}

.profile-select-btn:hover {
    background: rgba(255, 255, 255, 0.08);
}

.profile-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.profile-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.92rem;
    color: var(--muted);
}

.profile-menu-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: white;
}

.profile-menu-item.active {
    background: rgba(99, 102, 241, 0.08);
    color: white;
}

/* Notification bell specifics */
.badge-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: var(--danger);
    color: white;
    font-size: 0.72rem;
    font-weight: 700;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--bg);
}

.notif-item {
    display: flex;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 10px;
    transition: background 0.2s ease;
}

.notif-item:hover {
    background: rgba(255, 255, 255, 0.02);
}

.notif-item.unread {
    background: rgba(99, 102, 241, 0.03);
}

.notif-icon-wrapper {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.notif-icon-wrapper.award { background: rgba(245, 158, 11, 0.1); color: var(--warning); }
.notif-icon-wrapper.check { background: rgba(16, 185, 129, 0.1); color: var(--success); }
.notif-icon-wrapper.gift { background: rgba(236, 72, 153, 0.1); color: #ec4899; }
.notif-icon-wrapper.calendar { background: rgba(59, 130, 246, 0.1); color: #3b82f6; }
.notif-icon-wrapper.info { background: rgba(148, 163, 184, 0.1); color: var(--muted); }

.notif-icon-wrapper i { width: 16px; height: 16px; }

.notif-body {
    flex: 1;
}

.notif-title {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text);
}

.notif-message {
    font-size: 0.82rem;
    color: var(--muted);
    margin-top: 2px;
    word-break: break-word;
}

.notif-time {
    font-size: 0.75rem;
    color: var(--muted);
    opacity: 0.7;
    margin-top: 4px;
}

.notif-empty {
    padding: 30px;
    text-align: center;
    color: var(--muted);
    font-size: 0.9rem;
}

.text-link {
    background: transparent;
    border: none;
    color: var(--primary);
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    font-family: inherit;
}

.text-link:hover {
    text-decoration: underline;
}

/* Modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(2, 6, 23, 0.7);
    backdrop-filter: blur(10px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal.show {
    display: flex;
}

.modal-content {
    width: 100%;
    max-width: 500px;
    padding: 30px;
    position: relative;
    animation: zoomIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 12px;
}

.close-btn {
    font-size: 1.8rem;
    cursor: pointer;
    opacity: 0.7;
}

.close-btn:hover {
    opacity: 1;
}

@keyframes zoomIn {
    from {
        transform: scale(0.95);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* PIN Verification Page and Keypad */
.pin-verification-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 70vh;
}

.pin-card {
    width: 100%;
    max-width: 360px;
    padding: 40px 30px;
    text-align: center;
}

.pin-avatar-wrapper {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid transparent;
    padding: 4px;
    margin: 0 auto 20px;
}

.pin-avatar-initial {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 700;
}

.pin-title {
    font-size: 1.25rem;
    font-weight: 700;
}

.pin-subtitle {
    font-size: 0.88rem;
    color: var(--muted);
    margin-top: 8px;
    margin-bottom: 24px;
}

.pin-input-group {
    margin-bottom: 24px;
}

.pin-input-box {
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid var(--border);
    border-radius: 12px;
    width: 160px;
    padding: 12px;
    font-size: 1.8rem;
    letter-spacing: 12px;
    text-align: center;
    color: white;
    font-weight: 700;
}

.numpad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    max-width: 260px;
    margin: 0 auto;
}

.numpad-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: rgba(255,255,255,0.03);
    color: white;
    font-size: 1.5rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease;
    margin: 0 auto;
}

.numpad-btn:hover {
    background: rgba(255,255,255,0.08);
    border-color: var(--border-hover);
}

.numpad-btn.text {
    border-radius: 12px;
    width: 100%;
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
}

.numpad-btn.text.valider {
    background: var(--primary);
    border-color: var(--primary);
}

.numpad-btn.text.valider:hover {
    background: var(--primary-dark);
}

/* Empty States */
.empty-state {
    color: var(--muted);
    font-size: 0.95rem;
}

.dashboard-empty-state {
    padding: 40px 0;
    text-align: center;
    color: var(--muted);
}

.dashboard-empty-state i {
    width: 48px;
    height: 48px;
    stroke: var(--muted);
    opacity: 0.6;
    margin-bottom: 12px;
}

/* Scrollbars */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(2, 6, 23, 0.3);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 99px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}


/* ==========================================================================
   Meals and Shopping Extensions Styles
   ========================================================================== */

/* 1. Meal Planner Styles */
.week-navigation-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    margin-bottom: 24px;
}

.week-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.15rem;
    font-weight: 700;
    color: white;
}

.week-title i {
    width: 22px;
    height: 22px;
}

.week-actions-nav {
    display: flex;
    gap: 12px;
}

.meals-week-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 16px;
    align-items: start;
}

.day-column {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-height: 500px;
}

.today-day-card {
    border-color: rgba(99, 102, 241, 0.4) !important;
    background: rgba(99, 102, 241, 0.03) !important;
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.1) !important;
}

.day-header {
    text-align: center;
    border-bottom: 1px solid var(--border);
    padding-bottom: 12px;
}

.day-header h3 {
    font-size: 1rem;
    font-weight: 700;
    color: white;
    margin-bottom: 2px;
}

.day-date {
    font-size: 0.8rem;
    color: var(--muted);
}

.day-meals-stack {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.meal-slot-item {
    border: 1px solid rgba(255, 255, 255, 0.03);
    background: rgba(255, 255, 255, 0.01);
    border-radius: 12px;
    padding: 10px 12px;
    position: relative;
    transition: all 0.2s ease;
}

.meal-slot-item:hover {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.08);
}

.slot-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.slot-meta i {
    width: 14px;
    height: 14px;
}

/* Icons colors for meal categories */
.breakfast-slot .slot-meta i { color: #f59e0b; }
.lunch-slot .slot-meta i { color: #3b82f6; }
.snack-slot .slot-meta i { color: #ec4899; }
.dinner-slot .slot-meta i { color: #8b5cf6; }

.meal-slot-content {
    position: relative;
}

.meal-recipe {
    font-size: 0.88rem;
    font-weight: 600;
    color: white;
    line-height: 1.4;
    word-break: break-word;
}

.meal-notes {
    font-size: 0.78rem;
    color: var(--muted);
    margin-top: 4px;
    line-height: 1.3;
}

.meal-actions-hover {
    display: flex;
    gap: 6px;
    position: absolute;
    right: -4px;
    top: -22px;
    opacity: 0;
    transition: opacity 0.2s ease;
    background: var(--surface-solid);
    padding: 4px 6px;
    border-radius: 8px;
    border: 1px solid var(--border);
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.meal-slot-item:hover .meal-actions-hover {
    opacity: 1;
}

.btn-icon-action {
    background: none;
    border: none;
    padding: 2px;
    cursor: pointer;
    color: var(--muted);
    transition: color 0.2s ease;
}

.btn-icon-action:hover {
    color: white;
}

.btn-icon-action.delete-act:hover {
    color: var(--danger);
}

.btn-icon-action i {
    width: 13px;
    height: 13px;
}

.meal-slot-empty {
    padding: 4px 0;
}

.add-meal-slot-btn {
    width: 100%;
    background: none;
    border: 1px dashed var(--border);
    border-radius: 8px;
    padding: 6px;
    color: var(--muted);
    font-size: 0.78rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.add-meal-slot-btn:hover {
    border-color: var(--primary);
    color: white;
    background: rgba(99, 102, 241, 0.05);
}

.add-meal-slot-btn i {
    width: 14px;
    height: 14px;
}


/* 2. Shopping List Styles */
.shopping-action-card {
    padding: 20px 24px;
    margin-bottom: 24px;
}

.shopping-add-form .form-group-row {
    display: flex;
    gap: 16px;
    align-items: center;
    width: 100%;
}

.shopping-add-form .input-name-wrap {
    flex: 2;
}

.shopping-add-form .input-qty-wrap {
    flex: 1;
}

.shopping-add-form .select-cat-wrap {
    flex: 1;
}

.shopping-add-form button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    white-space: nowrap;
}

.shopping-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
    padding: 0 4px;
}

.active-item-count {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.shopping-categories-stack {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.category-block {
    padding: 24px;
}

.category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
    padding-bottom: 12px;
    margin-bottom: 16px;
}

.category-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: white;
    margin: 0;
}

.category-badge {
    font-size: 0.8rem;
    padding: 4px 10px;
    border-radius: 99px;
    background: rgba(255,255,255,0.05);
    color: var(--muted);
    font-weight: 600;
}

.category-items-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.shopping-item-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-radius: 12px;
    background: rgba(255,255,255,0.01);
    border: 1px solid rgba(255,255,255,0.02);
    transition: all 0.2s ease;
}

.shopping-item-row:hover {
    background: rgba(255,255,255,0.03);
    border-color: rgba(255,255,255,0.06);
}

.shopping-checkbox-label {
    display: flex;
    align-items: center;
    gap: 14px;
    cursor: pointer;
    flex: 1;
}

.shopping-checkbox-label input {
    display: none;
}

.custom-shopping-checkbox {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.custom-shopping-checkbox i {
    width: 12px;
    height: 12px;
    stroke: white;
    stroke-width: 3px;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.shopping-checkbox-label input:checked ~ .custom-shopping-checkbox {
    background-color: var(--success);
    border-color: var(--success);
}

.shopping-checkbox-label input:checked ~ .custom-shopping-checkbox i {
    opacity: 1;
}

.shopping-item-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: white;
    transition: all 0.2s ease;
}

.shopping-item-quantity {
    font-size: 0.8rem;
    color: var(--muted);
    background: rgba(255,255,255,0.03);
    padding: 2px 8px;
    border-radius: 6px;
    margin-left: 4px;
}

/* Purchased faded effect */
.shopping-item-row.purchased {
    opacity: 0.55;
}

.shopping-item-row.purchased .shopping-item-name {
    text-decoration: line-through;
    color: var(--muted);
}

.creator-tag {
    font-size: 0.72rem;
    padding: 3px 8px;
    border-radius: 6px;
    font-weight: 600;
}

.empty-shopping-state {
    padding: 60px 40px;
    text-align: center;
}

.empty-icon-wrap {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(99, 102, 241, 0.08);
    color: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px auto;
}

.empty-icon-wrap i {
    width: 32px;
    height: 32px;
}

.empty-shopping-state h3 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: white;
}

.empty-shopping-state p {
    color: var(--muted);
    font-size: 0.9rem;
    max-width: 440px;
    margin: 0 auto;
}

/* Responsive Extensions */
@media (max-width: 1200px) {
    .meals-week-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    .day-column {
        min-height: auto;
    }
}

@media (max-width: 768px) {
    .week-navigation-card {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }
    .shopping-add-form .form-group-row {
        flex-direction: column;
        align-items: stretch;
    }
}


/* 3. Family Challenges & Team Quests Styles */
.challenges-container {
    max-width: 1000px;
    margin: 0 auto;
}

.active-challenge-card {
    padding: 30px;
    margin-bottom: 30px;
    position: relative;
    overflow: hidden;
}

.active-challenge-card::before {
    content: '';
    position: absolute;
    top: -50px;
    right: -50px;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(245, 158, 11, 0.08) 0%, rgba(99, 102, 241, 0.03) 50%, transparent 100%);
    filter: blur(40px);
    z-index: 0;
}

.challenge-main-info {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    margin-bottom: 24px;
    position: relative;
    z-index: 1;
}

.challenge-trophy-badge {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--primary) 0%, #a855f7 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.3);
    flex-shrink: 0;
}

.challenge-trophy-badge i {
    width: 26px;
    height: 26px;
}

.challenge-text h3 {
    font-size: 1.35rem;
    font-weight: 800;
    color: white;
    margin-bottom: 6px;
}

.challenge-desc {
    font-size: 0.95rem;
    color: var(--muted);
    line-height: 1.5;
    margin-bottom: 12px;
}

.challenge-reward-highlight {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    border-radius: 10px;
    background: rgba(236, 72, 153, 0.08);
    border: 1px solid rgba(236, 72, 153, 0.15);
    color: #ec4899;
    font-size: 0.9rem;
}

.challenge-reward-highlight i {
    width: 18px;
    height: 18px;
}

.challenge-progress-container {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
}

.progress-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-weight: 700;
}

.progress-points {
    font-size: 1.1rem;
    color: white;
}

.progress-percent {
    font-size: 1.1rem;
    color: var(--primary-light);
}

.progress-bar-bg {
    height: 12px;
    background: rgba(2, 6, 23, 0.4);
    border-radius: 99px;
    overflow: hidden;
    margin-bottom: 12px;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(to right, var(--primary) 0%, #a855f7 50%, var(--success) 100%);
    border-radius: 99px;
    transition: width 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.challenge-due-date {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: var(--muted);
}

.challenge-due-date i {
    width: 14px;
    height: 14px;
}

.challenge-admin-actions {
    display: flex;
    justify-content: flex-end;
    position: relative;
    z-index: 1;
}

/* Creation Card */
.challenge-create-card {
    padding: 24px;
}

.empty-challenge-state {
    padding: 60px 40px;
    text-align: center;
}

.empty-icon-wrap.select-yellow {
    background: rgba(245, 158, 11, 0.08);
    color: #f59e0b;
}

/* History Completed Challenges */
.completed-challenges-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.completed-challenge-card {
    display: flex;
    gap: 16px;
    padding: 20px;
    align-items: center;
}

.completed-badge-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(16, 185, 129, 0.2);
    flex-shrink: 0;
}

.completed-badge-icon i {
    width: 20px;
    height: 20px;
}

.completed-challenge-body h4 {
    font-size: 1rem;
    font-weight: 700;
    color: white;
    margin-bottom: 4px;
}

.reward-desc-claim {
    font-size: 0.85rem;
    color: var(--muted);
    margin-bottom: 8px;
}

.reward-desc-claim strong {
    color: #ec4899;
}

.completed-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.72rem;
    color: var(--muted);
}

.points-reached-badge {
    color: var(--success);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 2px;
}

.points-reached-badge i {
    width: 12px;
    height: 12px;
}


/* 4. Avatars and Emojis styling */
.profile-avatar-emoji {
    font-size: 1.2rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
}

.profile-avatar-img {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    border: 1.5px solid rgba(255, 255, 255, 0.2);
}

.member-avatar-img-card {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    object-fit: cover;
    border: 2.5px solid;
    flex-shrink: 0;
}

.member-avatar-circle.emoji {
    font-size: 1.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.assignee-avatar-mini.img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    border: 1.5px solid;
    margin-left: -6px;
    flex-shrink: 0;
}

.assignee-avatar-mini.emoji {
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1.5px solid;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    margin-left: -6px;
    flex-shrink: 0;
}

.member-avatar-img-mini {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 1.5px solid;
    flex-shrink: 0;
}

.avatar-circle-sm.emoji {
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 5. Mobile-first dropdown enhancements & profile names */
.profile-name {
    max-width: 120px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.88rem;
    font-weight: 600;
}

@media (max-width: 768px) {
    .profile-name {
        max-width: 70px;
    }
}

@media (max-width: 480px) {
    .topbar-right {
        position: static;
    }
    .profile-dropdown, .notification-dropdown {
        position: static;
    }
    .topbar .dropdown-menu {
        position: absolute !important;
        left: 16px !important;
        right: 16px !important;
        width: auto !important;
        top: calc(100% + 8px) !important;
        max-width: none !important;
    }
}

/* 6. Members lists & invite cards styles */
.member-avatar-circle {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.2rem;
    border: 2px solid;
    flex-shrink: 0;
}

.members-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.member-row-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.2s ease;
}

.member-row-item:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.08);
}

.member-meta {
    display: flex;
    align-items: center;
    gap: 16px;
}

.member-name {
    font-weight: 700;
    color: white;
    font-size: 1rem;
}

.member-role {
    font-size: 0.82rem;
    color: var(--muted);
    margin-top: 2px;
}

.member-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Invite Card Styling */
.invite-card {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(168, 85, 247, 0.05) 100%) !important;
    border: 1px solid rgba(99, 102, 241, 0.2) !important;
    padding: 24px !important;
    border-radius: 16px !important;
}

.invite-header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 20px;
}

.invite-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(99, 102, 241, 0.15);
    color: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.invite-icon i {
    width: 22px;
    height: 22px;
}

.invite-header h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: white;
    margin-bottom: 6px;
    margin-top: 0;
}

.invite-header p {
    font-size: 0.88rem;
    color: var(--muted);
    line-height: 1.4;
    margin: 0;
}

.invite-code-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 10px 16px;
    border-radius: 12px;
    gap: 16px;
}

.invite-code {
    font-family: var(--font-mono, monospace);
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: 2px;
    color: var(--warning);
}

@media (max-width: 480px) {
    .invite-header {
        flex-direction: column;
        gap: 12px;
    }
    .invite-code-box {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
        gap: 12px;
    }
    .invite-code {
        font-size: 1.25rem;
    }
}