/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: url(pic/tree-bd2.jpg);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

/* Dark Mode Base */
html.dark-mode,
body.dark-mode {
    color: #e5e7eb;
    background: #0f172a;
    /* fallback color under background image */
}

/* Dark Mode Surfaces */
html.dark-mode .info-card,
html.dark-mode .order-item,
html.dark-mode .wishlist-item,
html.dark-mode .modal-content,
body.dark-mode .info-card,
body.dark-mode .order-item,
body.dark-mode .wishlist-item,
body.dark-mode .modal-content {
    background-color: #111827;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
}

/* Dark Mode Text */
html.dark-mode .section-title,
html.dark-mode .order-id,
html.dark-mode .wishlist-item h4,
html.dark-mode .modal-header h3,
html.dark-mode .username,
html.dark-mode .user-tagline,
html.dark-mode .field-label span,
html.dark-mode .field-value,
body.dark-mode .section-title,
body.dark-mode .order-id,
body.dark-mode .wishlist-item h4,
body.dark-mode .modal-header h3,
body.dark-mode .username,
body.dark-mode .user-tagline,
body.dark-mode .field-label span,
body.dark-mode .field-value {
    color: #e5e7eb;
}

/* Dark Mode Inputs */
html.dark-mode .edit-input,
body.dark-mode .edit-input {
    background-color: #0b1220;
    border-color: #1f2937;
    color: #e5e7eb;
}

html.dark-mode .modal-header,
body.dark-mode .modal-header {
    border-bottom-color: #1f2937;
}

html.dark-mode .modal-close,
body.dark-mode .modal-close {
    background-color: #0b1220;
    color: #e5e7eb;
}

html.dark-mode .modal-close:hover,
body.dark-mode .modal-close:hover {
    background-color: #111827;
}

/* Dark Mode Discover Buttons */
html.dark-mode .discover-btn,
body.dark-mode .discover-btn {
    background: rgba(30, 41, 59, 0.8);
    border-color: rgba(71, 85, 105, 0.5);
}

html.dark-mode .discover-btn:hover,
body.dark-mode .discover-btn:hover {
    background: rgba(30, 41, 59, 0.95);
}


/* Top Navigation Bar */
.top-nav {
    background-color: #00A651;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    height: var(--app-nav-height);
    box-sizing: border-box;
    position: relative;
    /* Ensure container positioning works */
}

/* --- HANGING MOON (DARK MODE ONLY) --- */
.hanging-moon-container {
    position: absolute;
    top: 100%;
    /* Attach to bottom of nav */
    right: 70px;
    /* Position next to settings */
    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;
    /* Subtle detail inside the moon */
}

@keyframes moonSwing {

    0%,
    100% {
        transform: rotate(-5deg);
    }

    50% {
        transform: rotate(5deg);
    }
}

.nav-left .back-icon {
    width: 24px;
    height: 24px;
    cursor: pointer;
    transition: transform 0.2s ease;
    filter: brightness(0) invert(1);
    margin-right: 15px;
}

.quick-discover-section {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 4px;
    /* padding: 10px 0; */
    align-items: flex-start;
    z-index: 10;
    margin-top: 10px;
    margin-bottom: -185px;
}

.discover-btn {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    padding: 10px 10px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    font-weight: 600;
    color: #2D3436;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    width: fit-content;
    min-width: 100px;
}

.discover-btn i {
    font-size: 16px;
    transition: transform 0.4s ease;
}

.discover-btn span {
    letter-spacing: 0.3px;
}

/* Hover & Premium States */
.discover-btn:hover {
    background: #ffffff;
    transform: translateX(10px) scale(1.02);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    color: #00A651;
}

.discover-btn:hover i {
    transform: rotate(-10deg) scale(1.2);
}

.discover-btn:active {
    transform: scale(0.95) translateX(5px);
}

/* Unique Accents */
.about-trigger {
    border-left: 4px solid #00A651;
}

.benefits-trigger {
    border-left: 4px solid #FF9F43;
}

.terms-trigger {
    border-left: 4px solid #3B82F6;
}

.privacy-trigger {
    border-left: 4px solid #8B5CF6;
}

.benefits-trigger i {
    color: #FF9F43;
}

.terms-trigger i {
    color: #3B82F6;
}

.privacy-trigger i {
    color: #8B5CF6;
}

.about-trigger i {
    color: #00A651;
}

/* --- SUPER UNIQUE MORPH BUTTON --- */
.morph-btn {
    position: relative;
    width: 100px !important;
    /* Slightly narrower for nav */
    height: 36px !important;
    /* Slightly shorter for nav */
    padding: 0 !important;
    border-radius: 18px !important;
    overflow: hidden !important;
    border: none !important;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
}

.morph-track {
    display: flex;
    flex-direction: column;
    height: 300%;
    width: 100%;
    animation: morphVerticalCycle 8s cubic-bezier(0.85, 0, 0.15, 1) infinite;
}

.morph-state {
    height: 100%;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

/* State Themes Refined for Green Nav */
.state-web {
    background: #ffffff;
    color: #00A651;
}

.state-explore {
    background: #008f45;
    /* Darker green */
    color: #ffffff;
    overflow: hidden;
}

.state-explore i {
    animation: rocketFly 2.66s infinite ease-in;
    /* Sync with 8s cycle (8/3) */
}

@keyframes rocketFly {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 1;
    }

    40% {
        transform: translate(0, 0) scale(1.5);
        opacity: 1;
    }

    70% {
        transform: translate(20px, -40px) scale(2);
        opacity: 0;
    }

    71% {
        transform: translate(-20px, 40px) scale(0.5);
        opacity: 0;
    }

    100% {
        transform: translate(0, 0) scale(1);
        opacity: 1;
    }
}

.state-universe {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: #38bdf8;
    position: relative;
    box-shadow: inset 0 0 15px rgba(56, 189, 248, 0.4);
    overflow: hidden;
}

.state-universe i {
    text-shadow: 0 0 10px #38bdf8;
    animation: starPulseFly 2.66s infinite ease-in;
}

@keyframes starPulseFly {
    0% {
        transform: scale(1) rotate(0);
        opacity: 1;
    }

    40% {
        transform: scale(3) rotate(180deg);
        opacity: 1;
        filter: blur(0px);
    }

    70% {
        transform: scale(6) rotate(360deg);
        opacity: 0;
        filter: blur(4px);
    }

    71% {
        transform: scale(0) rotate(0);
        opacity: 0;
    }

    100% {
        transform: scale(1) rotate(0);
        opacity: 1;
    }
}

.state-universe::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, rgba(56, 189, 248, 0.2) 0%, transparent 70%);
    animation: pulseGlow 2s infinite ease-in-out;
}

/* Hover Effects */
.morph-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.4), 0 0 10px rgba(0, 166, 81, 0.3);
}

.morph-btn:active {
    transform: scale(0.95);
}

/* Glint Animation */
.morph-glint {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(120deg,
            transparent,
            rgba(255, 255, 255, 0.3),
            transparent);
    animation: glintMove 4s infinite linear;
    pointer-events: none;
}

/* Animations */
@keyframes morphVerticalCycle {

    0%,
    25% {
        transform: translateY(0);
    }

    29% {
        transform: translateY(-35.333%);
    }

    33%,
    58% {
        transform: translateY(-33.333%);
    }

    62% {
        transform: translateY(-68.666%);
    }

    66%,
    91% {
        transform: translateY(-66.666%);
    }

    95% {
        transform: translateY(2%);
    }

    100% {
        transform: translateY(0);
    }
}

@keyframes pulseGlow {

    0%,
    100% {
        opacity: 0.5;
        transform: scale(1);
    }

    50% {
        opacity: 1;
        transform: scale(1.2);
    }
}

@keyframes glintMove {
    0% {
        left: -100%;
    }

    15%,
    100% {
        left: 100%;
    }
}

/* Dark Mode Support for Morph Button */
html.dark-mode .state-web,
body.dark-mode .state-web {
    background: #1e293b;
    color: #10b981;
}

html.dark-mode .morph-btn,
body.dark-mode .morph-btn {
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4);
}


.nav-left {
    display: flex;
    align-items: center;
}

.nav-left .back-icon:hover {
    transform: scale(1.1);
}

.nav-center .nav-title {
    color: white;
    font-size: 30px;
    /* Increased font size */
    font-weight: 700;
    /* Bolder font weight */
    margin: 0;
    position: relative;
    letter-spacing: 1.5px;
    overflow: hidden;
    background: white;
    background-size: 200% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

@keyframes gradientShift {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

@keyframes scaleBounce {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}

.nav-right .settings-btn {
    width: 40px;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.nav-right .settings-btn:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

.nav-right .settings-btn i {
    color: white;
    font-size: 16px;
}

/* Main Content */
.main-content {
    padding: 0 20px calc(110px + env(safe-area-inset-bottom)) 20px;
    min-height: calc(100vh - var(--app-nav-height) - 70px);
    display: flex;
    flex-direction: column;
    gap: 25px;
}

/* Profile Header */
.profile-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 30px 0;
}

.profile-picture-container {
    position: relative;
    margin-bottom: 20px;
}

.profile-picture {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid white;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease;
}

.profile-picture:hover {
    transform: scale(1.05);
}

.change-photo-overlay {
    position: absolute;
    bottom: 0;
    right: 0;
    background-color: #00A651;
    color: white;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    box-shadow: 0 4px 15px rgba(0, 166, 81, 0.3);
    transition: transform 0.2s ease;
}

.change-photo-overlay:hover {
    transform: scale(1.05);
}

.change-photo-overlay i {
    font-size: 15px;
}

.username {
    font-size: 24px;
    font-weight: 700;
    color: #3d3d3d;
    margin-bottom: 8px;
    word-break: break-word;
    line-height: 1.2;
    max-width: 100%;
}

.user-tagline {
    font-weight: 600;
    font-size: 14px;
    color: #000000;
    margin-bottom: 20px;
}

.edit-profile-btn {
    background-color: #00A651;
    color: white;
    border: none;
    border-radius: 25px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.edit-profile-btn:hover {
    background-color: #008f45;
    transform: translateY(-2px);
}

/* Profile Information Section */
.profile-info-section {
    margin-bottom: 25px;
}

.info-card {
    background-color: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.section-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 20px;
    text-align: center;
}

.info-field {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #f0f0f0;
}

.info-field:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.field-label {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    position: relative;
}

.field-label i:first-child {
    color: #00A651;
    font-size: 16px;
    width: 20px;
}

.field-label span {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    flex: 1;
}

.edit-icon {
    color: #00A651;
    font-size: 14px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.edit-icon:hover {
    transform: scale(1.2);
}

.field-value {
    font-size: 14px;
    color: #666;
    padding-left: 30px;
}

.field-edit {
    margin-top: 10px;
}

.edit-input {
    width: 100%;
    padding: 10px 15px;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.3s ease;
    margin-bottom: 10px;
}

.edit-input:focus {
    border-color: #00A651;
    box-shadow: 0 0 0 3px rgba(0, 166, 81, 0.1);
}

.edit-buttons {
    display: flex;
    gap: 10px;
}

.save-btn,
.cancel-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.save-btn {
    background-color: #00A651;
    color: white;
}

.save-btn:hover {
    background-color: #008f45;
    transform: scale(1.05);
}

.cancel-btn {
    background-color: #f8f9fa;
    color: #666;
    border: 1px solid #e9ecef;
}

.cancel-btn:hover {
    background-color: #e9ecef;
    transform: scale(1.05);
}

/* Orders Section */
.orders-section {
    margin-bottom: 25px;
}

.orders-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-height: 300px;
    overflow-y: auto;
    padding-right: 5px;
}

.orders-list::-webkit-scrollbar {
    width: 6px;
}

.orders-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.orders-list::-webkit-scrollbar-thumb {
    background: #00A651;
    border-radius: 10px;
}

.orders-list::-webkit-scrollbar-thumb:hover {
    background: #008f45;
}

.order-item {
    background-color: white;
    border-radius: 15px;
    padding: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.order-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.15);
}

.order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.order-id {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.order-status {
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

.order-status.delivered {
    background-color: #d4edda;
    color: #155724;
}

.order-status.pending {
    background-color: #fff3cd;
    color: #856404;
}

.order-status.canceled {
    background-color: #f8d7da;
    color: #721c24;
}

.order-products {
    display: flex;
    gap: 12px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.order-product-wrapper {
    position: relative;
    width: 44px;
    height: 44px;
}

.order-product-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #00A651;
}

.product-mini-badge {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 8px;
    color: white;
    border: 1.5px solid white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    z-index: 5;
}

.product-mini-badge.to-rate {
    background: linear-gradient(135deg, #ff9f43, #ff6b6b);
}

.product-mini-badge.reviewed {
    background: linear-gradient(135deg, #00A651, #008f45);
}

.order-total {
    font-size: 14px;
    font-weight: 700;
    color: #00A651;
    text-align: right;
}

.order-details {
    display: none;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #f0f0f0;
}

.order-details.show {
    display: block;
}

.order-details p {
    margin: 5px 0;
    font-size: 12px;
}

.order-details ul {
    margin: 8px 0;
    padding-left: 0;
    list-style: none;
}

.profile-order-product-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: #f8fafc;
    border-radius: 10px;
    margin-bottom: 6px !important;
    border: 1px solid #f1f5f9;
}

.product-name-qty {
    font-size: 13px;
    font-weight: 500;
    color: #475569;
}

.rate-btn-profile {
    background: linear-gradient(135deg, #00A651 0%, #008f45 100%);
    color: white;
    border: none;
    border-radius: 20px;
    padding: 5px 12px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0, 166, 81, 0.2);
}

.rate-btn-profile:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 166, 81, 0.3);
    background: linear-gradient(135deg, #008f45 0%, #00A651 100%);
}

.rate-btn-profile i {
    font-size: 10px;
}

.review-thanks {
    background: #e6fffa;
    color: #047481;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 10.5px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
    border: 1px solid #b2f5ea;
}

.review-thanks i {
    font-size: 12px;
}

/* Wishlist Section */
.wishlist-section {
    margin-bottom: 25px;
}

.wishlist-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.empty-wishlist {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 20px;
    background-color: white;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.empty-wishlist i {
    font-size: 48px;
    color: #ccc;
    margin-bottom: 15px;
}

.empty-wishlist p {
    font-size: 16px;
    color: #666;
    margin: 0;
}

.wishlist-item {
    background-color: white;
    border-radius: 15px;
    padding: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
}

.remove-wishlist-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: none;
    background-color: #ff4757;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(255, 71, 87, 0.3);
}

.remove-wishlist-btn:hover {
    transform: scale(1.1);
    background-color: #ee3344;
    box-shadow: 0 4px 12px rgba(255, 71, 87, 0.5);
}

.remove-wishlist-btn i {
    font-size: 12px;
}

.wishlist-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.wishlist-item img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 10px;
    border: 3px solid #00A651;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.wishlist-item h4 {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.wishlist-item .price {
    font-size: 16px;
    font-weight: 700;
    color: #00A651;
    margin-bottom: 10px;
}

.add-to-cart-btn {
    background-color: #00A651;
    color: white;
    border: none;
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.add-to-cart-btn i {
    font-size: 11px;
}

.add-to-cart-btn:hover {
    background-color: #008f45;
    transform: scale(1.05);
}

/* Settings Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.show {
    opacity: 1;
}

.modal-content {
    background-color: white;
    border-radius: 20px;
    max-width: 90%;
    max-height: 90%;
    overflow-y: auto;
    position: relative;
    transform: scale(0.8);
    transition: transform 0.3s ease;
}

.modal-overlay.show .modal-content {
    transform: scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid #f0f0f0;
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.modal-close {
    width: 35px;
    height: 35px;
    background-color: #f8f9fa;
    border: none;
    border-radius: 50%;
    color: #666;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.modal-close:hover {
    background-color: #e9ecef;
}

.modal-body {
    padding: 20px 0;
}

.settings-option {
    display: flex;
    align-items: center;
    padding: 15px 25px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    gap: 15px;
}

.settings-option:hover {
    background-color: #f8f9fa;
}

.settings-option i:first-child {
    color: #00A651;
    font-size: 18px;
    width: 20px;
}

.settings-option span {
    flex: 1;
    font-size: 14px;
    color: #333;
}

.settings-option i:last-child {
    color: #ccc;
    font-size: 12px;
}

.logout-option {
    border-top: 1px solid #f0f0f0;
    margin-top: 10px;
}

.logout-option i:first-child {
    color: #dc3545;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.4s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
}

input:checked+.toggle-slider {
    background-color: #00A651;
}

input:checked+.toggle-slider:before {
    transform: translateX(26px);
}

/* Responsive Design */
@media (max-width: 480px) {
    .main-content {
        padding: 0 15px 90px 15px;
        gap: 20px;
    }

    .profile-picture {
        width: 100px;
        height: 100px;
    }

    .username {
        font-size: 20px;
        line-height: 1.25;
        word-break: break-word;
    }

    .info-card {
        padding: 20px;
    }

    .wishlist-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .nav-center .nav-title {
        font-size: 24px !important;
    }

    .hanging-moon-container {
        position: absolute;
        top: 100%;
        right: 20px;
        display: none;
        flex-direction: column;
        align-items: center;
        z-index: 1001;
        pointer-events: none;
        transform-origin: top center;
        animation: moonSwing 4s ease-in-out infinite;
    }

    .wishlist-item img {
        width: 70px;
        height: 70px;
    }

    .order-item {
        padding: 15px;
    }

    .order-product-img {
        width: 40px;
        height: 40px;
    }
}

@media (min-width: 768px) {
    .nav-center .nav-title {
        font-size: 24px;
    }

    .wishlist-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Animation for page load */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.profile-header,
.info-card,
.order-item,
.wishlist-item {
    animation: fadeInUp 0.6s ease forwards;
}

.info-card {
    animation-delay: 0.1s;
}

.order-item {
    animation-delay: 0.2s;
}

.wishlist-item {
    animation-delay: 0.3s;
}

/* Focus states for accessibility */
.edit-profile-btn:focus,
.save-btn:focus,
.cancel-btn:focus,
.add-to-cart-btn:focus,
.settings-option:focus {
    outline: 2px solid #00A651;
    outline-offset: 2px;
}

/* Loading and Empty States */
.loading {
    text-align: center;
    padding: 20px;
    color: #00A651;
    font-weight: 500;
}

.empty-orders {
    text-align: center;
    padding: 40px 20px;
    background-color: white;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.empty-orders i {
    font-size: 48px;
    color: #ccc;
    margin-bottom: 15px;
}

.empty-orders p {
    font-size: 16px;
    color: #666;
    margin: 0;
}

html.dark-mode .empty-orders,
body.dark-mode .empty-orders {
    background-color: #111827;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
}

html.dark-mode .empty-orders p,
body.dark-mode .empty-orders p {
    color: #e5e7eb;
}

/* Layout & App Shell Overrides */
.main-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    padding-bottom: calc(110px + env(safe-area-inset-bottom));
    z-index: 1;
}

#footerContainer,
.bottom-nav {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    flex-shrink: 0;
    width: 100%;
    z-index: 3000;
    padding-bottom: calc(12px + env(safe-area-inset-bottom)) !important;
}

.top-nav {
    flex-shrink: 0;
}

/* Password Visibility Toggle Styles */
.password-input-wrapper {
    position: relative;
    width: 100%;
    margin-bottom: 15px;
}

.password-input-wrapper .edit-input,
.password-input-wrapper .modal-input {
    padding-right: 45px !important;
}

.toggle-password {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #00A651;
    cursor: pointer;
    font-size: 16px;
    z-index: 10;
    padding: 5px;
    transition: all 0.2s ease;
}

.toggle-password:hover {
    color: #008f45;
    transform: translateY(-50%) scale(1.1);
}

.toggle-password:active {
    transform: translateY(-50%) scale(0.9);
}

html.dark-mode .toggle-password {
    color: #10b981;
}

/* Profile Tabs */
.profile-tabs-container {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
    padding: 0 10px;
}

.profile-tabs {
    display: flex;
    background: rgba(255, 255, 255, 0.2);
    padding: 5px;
    border-radius: 30px;
    gap: 10px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.4);
}

.tab-btn {
    background: transparent;
    border: none;
    padding: 10px 25px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    color: #4a5568;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 8px;
}

.tab-btn i {
    font-size: 16px;
}

.tab-btn.active {
    background: #00A651;
    color: white;
    box-shadow: 0 4px 15px rgba(0, 166, 81, 0.3);
}

.tab-btn:hover:not(.active) {
    background: rgba(255, 255, 255, 0.5);
    color: #00A651;
}

html.dark-mode .profile-tabs {
    background: rgba(17, 24, 39, 0.6);
    border-color: rgba(255, 255, 255, 0.1);
}

html.dark-mode .tab-btn {
    color: #e5e7eb;
}

html.dark-mode .tab-btn.active {
    color: white;
}

/* Address Management Layout */
.address-management-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
    min-height: 400px;
}

@media (max-width: 900px) {
    .address-management-container {
        grid-template-columns: 1fr;
    }

    .address-form-panel {
        display: none;
        /* Hidden by default on mobile, shown as modal */
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 100%;
        z-index: 2000;
        align-items: flex-end;
        /* Slide up validation */
        background: rgba(0, 0, 0, 0.5);
        backdrop-filter: blur(5px);
    }

    .address-form-panel.active {
        display: flex;
        animation: fadeIn 0.3s ease;
    }

    .address-form-panel.active .form-card {
        animation: slideUp 0.4s cubic-bezier(0.19, 1, 0.22, 1);
    }
}

/* Address List Panel */
.address-list-panel {
    background: transparent;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.panel-header h3 {
    font-size: 18px;
    font-weight: 700;
    color: #2d3748;
}

html.dark-mode .panel-header h3 {
    color: #e5e7eb;
}

.add-new-btn-mobile {
    display: none;
}

@media (max-width: 900px) {
    .add-new-btn-mobile {
        display: flex;
        align-items: center;
        gap: 6px;
        background: #00A651;
        color: white;
        border: none;
        padding: 8px 16px;
        border-radius: 20px;
        font-size: 13px;
        font-weight: 600;
        cursor: pointer;
    }
}

.address-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding-bottom: 20px;
}

/* Address Card */
.address-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 16px;
    padding: 20px;
    position: relative;
    transition: all 0.3s ease;
    cursor: pointer;
    overflow: hidden;
}

html.dark-mode .address-card {
    background: rgba(30, 41, 59, 0.6);
    border-color: rgba(255, 255, 255, 0.1);
}

.address-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    background: rgba(255, 255, 255, 0.9);
}

html.dark-mode .address-card:hover {
    background: rgba(30, 41, 59, 0.8);
}

.address-card.selected {
    border: 2px solid #00A651;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 4px 20px rgba(0, 166, 81, 0.15);
}

html.dark-mode .address-card.selected {
    background: rgba(30, 41, 59, 0.9);
    border-color: #00A651;
}

.card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.addr-label-badge {
    background: #e6fffa;
    color: #00A651;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 6px;
}

html.dark-mode .addr-label-badge {
    background: rgba(0, 166, 81, 0.2);
}

.addr-default-badge {
    background: #00A651;
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
    display: none;
    /* hidden unless default */
}

.address-card.default .addr-default-badge {
    display: inline-block;
}

.addr-content h4 {
    font-size: 16px;
    font-weight: 700;
    color: #1a202c;
    margin-bottom: 5px;
}

html.dark-mode .addr-content h4 {
    color: white;
}

.addr-content p {
    font-size: 13px;
    color: #718096;
    margin: 3px 0;
    line-height: 1.5;
}

html.dark-mode .addr-content p {
    color: #94a3b8;
}

.card-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 15px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    padding-top: 15px;
}

html.dark-mode .card-actions {
    border-top-color: rgba(255, 255, 255, 0.1);
}

.action-btn {
    background: transparent;
    border: none;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.btn-edit {
    color: #3182ce;
    background: rgba(49, 130, 206, 0.1);
}

.btn-edit:hover {
    background: rgba(49, 130, 206, 0.2);
}

.btn-delete {
    color: #e53e3e;
    background: rgba(229, 62, 62, 0.1);
}

.btn-delete:hover {
    background: rgba(229, 62, 62, 0.2);
}

.btn-set-default {
    color: #00A651;
    background: rgba(0, 166, 81, 0.1);
    margin-right: auto;
    /* Push to left */
}

.btn-set-default:hover {
    background: rgba(0, 166, 81, 0.2);
}

/* Address Form Panel */
.form-card {
    background: white;
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    height: fit-content;
}

@media (max-width: 900px) {
    .form-card {
        width: 100%;
        border-radius: 20px 20px 0 0;
        max-height: 85vh;
        overflow-y: auto;
    }
}

html.dark-mode .form-card {
    background: #1e293b;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.form-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #f0f0f0;
}

html.dark-mode .form-header {
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

.form-header h3 {
    font-size: 18px;
    font-weight: 700;
    color: #2d3748;
}

html.dark-mode .form-header h3 {
    color: white;
}

.close-form-mobile {
    display: none;
}

@media (max-width: 900px) {
    .close-form-mobile {
        display: block;
        background: transparent;
        border: none;
        font-size: 20px;
        color: #718096;
    }
}

.form-group {
    margin-bottom: 15px;
}

.form-row {
    display: flex;
    gap: 15px;
}

.form-row .form-group {
    flex: 1;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #4a5568;
}

html.dark-mode .form-group label {
    color: #cbd5e1;
}

/* Premium Inputs */
.premium-input {
    width: 100%;
    padding: 12px 15px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    font-size: 14px;
    color: #333;
    transition: all 0.3s ease;
    font-family: inherit;
}

html.dark-mode .premium-input {
    background: #0f172a;
    border-color: #334155;
    color: white;
}

.premium-input:focus {
    border-color: #00A651;
    background: white;
    box-shadow: 0 0 0 3px rgba(0, 166, 81, 0.1);
    outline: none;
}

html.dark-mode .premium-input:focus {
    background: #1e293b;
}

/* Label Selector */
.label-selector {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.label-option {
    padding: 8px 16px;
    background: #f1f5f9;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    border: 1px solid transparent;
}

html.dark-mode .label-option {
    background: #334155;
    color: #cbd5e1;
}

.label-option:hover {
    background: #e2e8f0;
}

.label-option.selected {
    background: #e6fffa;
    color: #00A651;
    border-color: #00A651;
}

html.dark-mode .label-option.selected {
    background: rgba(0, 166, 81, 0.2);
}

/* Map Picker */
.map-picker-container {
    background: #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    border: 1px solid #cbd5e0;
}

.map-placeholder {
    height: 120px;
    background: #f1f5f9;
    position: relative;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.map-bg-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.8;
}

.map-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 2;
}

.map-overlay i {
    font-size: 24px;
    color: #e53e3e;
    margin-bottom: 5px;
    display: block;
}

.map-overlay span {
    font-size: 12px;
    font-weight: 600;
    color: #2d3748;
    background: rgba(255, 255, 255, 0.8);
    padding: 2px 8px;
    border-radius: 10px;
}

.lat-long-display {
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.03);
    font-size: 11px;
    color: #718096;
    display: flex;
    justify-content: space-between;
}

/* Form Actions */
.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    margin-top: 25px;
}

.btn-cancel {
    padding: 10px 20px;
    background: transparent;
    border: 1px solid #cbd5e0;
    border-radius: 10px;
    font-weight: 600;
    color: #718096;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-cancel:hover {
    background: #f7fafc;
}

.btn-save {
    padding: 10px 25px;
    background: #00A651;
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 166, 81, 0.3);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-save:hover {
    background: #008f45;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 166, 81, 0.4);
}

/* Animations */
@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.bounce {
    animation: bounce 2s infinite;
}

@keyframes bounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(-10px);
    }

    60% {
        transform: translateY(-5px);
    }
}

.empty-address-placeholder {
    text-align: center;
    padding: 40px 20px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 16px;
    margin-top: 20px;
}

.empty-address-placeholder i {
    font-size: 40px;
    color: #cbd5e0;
    margin-bottom: 10px;
}

/* --- MOON INTERACTION ANIMATIONS --- */
#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;
    }
}

/* Seller Portal Button */
.seller-cta-container {
    margin: 25px 0;
    padding: 0 5px;
}

.seller-portal-btn {
    width: 100%;
    background: linear-gradient(135deg, #00A651 0%, #008f45 100%);
    color: white;
    border: none;
    border-radius: 16px;
    padding: 18px 25px;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.5px;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(0, 166, 81, 0.25);
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    overflow: hidden;
}

.seller-portal-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.2) 50%, rgba(255, 255, 255, 0) 100%);
    transform: skewX(-25deg) translateX(-150%);
    transition: transform 0.5s;
}

.seller-portal-btn:hover::before {
    transform: skewX(-25deg) translateX(150%);
    transition: transform 0.7s;
}

.seller-portal-btn:hover {
    transform: translateY(-3px) scale(1.01);
    box-shadow: 0 15px 35px rgba(0, 166, 81, 0.35);
}

.seller-portal-btn i {
    font-size: 20px;
    background: rgba(255, 255, 255, 0.2);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.seller-btn-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    flex: 1;
    margin-left: 15px;
}

.seller-btn-title {
    font-size: 17px;
    font-weight: 700;
}

.seller-btn-subtitle {
    font-size: 12px;
    font-weight: 500;
    opacity: 0.9;
    margin-top: 2px;
}

html.dark-mode .seller-portal-btn {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
}

/* Cart Animation */
.cart-anim-track {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
    z-index: 1;
}

.cart-icon-anim {
    position: absolute;
    bottom: 12px;
    left: -40px;
    font-size: 24px !important;
    color: rgba(255, 255, 255, 0.25) !important;
    background: none !important;
    width: auto !important;
    height: auto !important;
    animation: driveCart 4s linear infinite;
    transform: rotate(-5deg);
}

.wind-lines {
    position: absolute;
    bottom: 18px;
    left: -60px;
    width: 30px;
    height: 2px;
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 -5px 0 rgba(255, 255, 255, 0.2), 0 5px 0 rgba(255, 255, 255, 0.2);
    animation: driveWind 4s linear infinite;
}

@keyframes driveCart {
    0% {
        left: -40px;
        opacity: 0;
        transform: rotate(-5deg) translateY(0);
    }

    5% {
        opacity: 1;
    }

    20% {
        transform: rotate(5deg) translateY(-2px);
    }

    40% {
        transform: rotate(-5deg) translateY(0);
    }

    60% {
        transform: rotate(5deg) translateY(-2px);
    }

    80% {
        opacity: 1;
    }

    90% {
        opacity: 0;
    }

    100% {
        left: 110%;
        opacity: 0;
        transform: rotate(-5deg) translateY(0);
    }
}

@keyframes driveWind {
    0% {
        left: -60px;
        opacity: 0;
    }

    5% {
        opacity: 0.5;
    }

    90% {
        opacity: 0.5;
    }

    100% {
        left: 105%;
        opacity: 0;
    }
}
