/* ================================================
   Temu-Inspired UI Redesign
   Color: Coral/Orange primary, clean white cards
   Style: Modern, vibrant, mobile-first
   ================================================ */

:root {
    --temu-primary: #FB6F20;
    --temu-primary-dark: #E55A0F;
    --temu-primary-light: #FFF3EB;
    --temu-secondary: #FF8F5E;
    --temu-accent: #F73C1A;
    --temu-success: #00B464;
    --temu-danger: #F44336;
    --temu-warning: #FFB800;
    --temu-bg: #F5F5F5;
    --temu-card: #FFFFFF;
    --temu-text: #1A1A1A;
    --temu-text-secondary: #666666;
    --temu-text-muted: #999999;
    --temu-border: #EEEEEE;
    --temu-shadow: 0 2px 12px rgba(0,0,0,0.06);
    --temu-shadow-hover: 0 4px 20px rgba(0,0,0,0.1);
    --temu-radius: 12px;
    --temu-radius-sm: 8px;
    --temu-radius-lg: 16px;
    --temu-radius-xl: 20px;
}

/* === Base Reset === */
html.deeppurple-theme,
html {
    background: var(--temu-bg) !important;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif !important;
    color: var(--temu-text) !important;
    background: var(--temu-bg) !important;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* === Header === */
.header {
    background: var(--temu-card) !important;
    box-shadow: 0 1px 0 var(--temu-border) !important;
    backdrop-filter: none !important;
    padding: 12px 16px !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 100 !important;
}

.header .btn-link {
    color: var(--temu-text) !important;
}

.header .material-icons {
    color: var(--temu-text) !important;
}

/* === Wrapper === */
.wrapper {
    background: var(--temu-bg) !important;
    padding-bottom: 90px !important;
}

/* === Cards === */
.card {
    border: none !important;
    border-radius: var(--temu-radius) !important;
    box-shadow: var(--temu-shadow) !important;
    overflow: hidden;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.card:hover {
    box-shadow: var(--temu-shadow-hover) !important;
}

.card-body {
    padding: 16px !important;
}

.card-footer {
    border-top: 1px solid var(--temu-border) !important;
    background: transparent !important;
}

/* === Primary Buttons === */
.btn-default,
.btn-primary,
.btn-important {
    background: linear-gradient(135deg, var(--temu-primary), var(--temu-secondary)) !important;
    color: #FFFFFF !important;
    border: none !important;
    border-radius: 50px !important;
    font-weight: 600 !important;
    font-size: 15px !important;
    padding: 12px 24px !important;
    box-shadow: 0 4px 14px rgba(251, 111, 32, 0.3) !important;
    transition: all 0.3s ease !important;
    letter-spacing: 0.3px;
}

.btn-default:hover,
.btn-primary:hover,
.btn-important:hover {
    background: linear-gradient(135deg, var(--temu-primary-dark), var(--temu-primary)) !important;
    box-shadow: 0 6px 20px rgba(251, 111, 32, 0.4) !important;
    transform: translateY(-1px);
}

.btn-default:active,
.btn-primary:active,
.btn-important:active {
    transform: translateY(0);
}

.btn-lg {
    font-size: 16px !important;
    padding: 14px 28px !important;
    border-radius: 50px !important;
}

/* === Secondary/Outline Buttons === */
.btn-outline-secondary,
.btn-outline-primary {
    border: 2px solid var(--temu-primary) !important;
    color: var(--temu-primary) !important;
    background: transparent !important;
    border-radius: 50px !important;
    font-weight: 600 !important;
    box-shadow: none !important;
}

.btn-outline-secondary:hover,
.btn-outline-primary:hover {
    background: var(--temu-primary-light) !important;
}

/* === Rounded 54 Buttons (icon buttons) === */
.btn-rounded-54 {
    width: 44px !important;
    height: 44px !important;
    border-radius: 50% !important;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: var(--temu-primary) !important;
    box-shadow: 0 3px 10px rgba(251, 111, 32, 0.25) !important;
}

.btn-rounded-54 .material-icons {
    color: #FFF !important;
}

/* === Template Color Overrides === */
.bg-template {
    background: linear-gradient(135deg, var(--temu-primary), var(--temu-secondary)) !important;
}

.bg-template-light {
    background: var(--temu-primary-light) !important;
}

.text-template {
    color: var(--temu-primary) !important;
}

.template-gradient {
    background: linear-gradient(135deg, var(--temu-primary), var(--temu-accent)) !important;
}

/* === Balance Card === */
.top-50 .card {
    background: linear-gradient(135deg, var(--temu-primary), var(--temu-secondary)) !important;
    color: #FFFFFF !important;
    border-radius: var(--temu-radius-lg) !important;
}

.top-50 .card h3 {
    color: #FFFFFF !important;
    font-weight: 700 !important;
    font-size: 28px !important;
}

.top-50 .card .text-mute {
    color: rgba(255,255,255,0.75) !important;
}

.top-50 .btn-rounded-54 {
    background: rgba(255,255,255,0.25) !important;
    box-shadow: none !important;
    backdrop-filter: blur(4px);
}

.top-50 .btn-rounded-54 .material-icons {
    color: #FFF !important;
}

/* === My Page Balance Card === */
.top-100 .card {
    border-radius: var(--temu-radius-lg) !important;
}

.top-100 .card .card-body {
    background: linear-gradient(135deg, var(--temu-primary), var(--temu-secondary)) !important;
    color: #FFFFFF !important;
}

.top-100 .card h3 {
    color: #FFFFFF !important;
    font-weight: 700 !important;
    font-size: 24px !important;
}

.top-100 .card .text-mute {
    color: rgba(255,255,255,0.75) !important;
}

.top-100 .btn-rounded-54 {
    background: rgba(255,255,255,0.25) !important;
    box-shadow: none !important;
}

.top-100 .btn-rounded-54 .material-icons {
    color: #FFF !important;
}

.top-100 .card-footer {
    background: var(--temu-card) !important;
    border-top: none !important;
    padding: 16px !important;
}

/* === Profile Card === */
.h-190 {
    background: linear-gradient(135deg, var(--temu-primary), var(--temu-secondary)) !important;
    border-radius: var(--temu-radius-lg) !important;
    color: #FFFFFF !important;
}

.h-190 h5,
.h-190 p,
.h-190 span {
    color: #FFFFFF !important;
}

.h-190 .text-mute {
    color: rgba(255,255,255,0.7) !important;
}

.h-190 .text-template {
    color: #FFFFFF !important;
}

.h-190 figure.avatar {
    border: 2px solid rgba(255,255,255,0.4) !important;
}

/* === Avatar === */
.avatar {
    border-radius: 50% !important;
}

.avatar-60 {
    width: 52px !important;
    height: 52px !important;
}

.avatar-30 {
    width: 36px !important;
    height: 36px !important;
}

.avatar .overlay {
    background: var(--temu-primary-light) !important;
    opacity: 0.15 !important;
    border-radius: 50% !important;
}

.avatar .material-icons {
    color: var(--temu-primary) !important;
}

/* === Menu Icons Grid - FIXED: Override Swiper with flexbox to prevent overlap === */
.icon-slide {
    overflow: visible !important;
}

.icon-slide .swiper-wrapper {
    display: flex !important;
    flex-wrap: nowrap !important;
    transform: none !important;
    transition: none !important;
    will-change: auto !important;
    align-items: flex-start !important;
    justify-content: space-around !important;
    gap: 8px !important;
}

.icon-slide .swiper-slide {
    width: auto !important;
    flex: 1 1 0 !important;
    min-width: 0 !important;
    max-width: 25% !important;
    transform: none !important;
    margin-right: 0 !important;
    text-align: center;
}

.icon-slide .avatar-60 {
    background: var(--temu-primary-light) !important;
    border-radius: 14px !important;
    width: 50px !important;
    height: 50px !important;
    margin: 0 auto;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.icon-slide .avatar-60 .overlay {
    display: none !important;
}

.icon-slide .avatar-60 .material-icons {
    color: var(--temu-primary) !important;
    font-size: 24px !important;
    position: relative !important;
    z-index: 1;
}

.icon-slide p.small {
    color: var(--temu-text-secondary) !important;
    font-size: 12px !important;
    margin-top: 6px !important;
}

/* === Subtitle === */
h6.subtitle {
    color: var(--temu-text) !important;
    font-weight: 700 !important;
    font-size: 16px !important;
    padding-bottom: 4px;
    border-bottom: none !important;
}

h5.subtitle {
    color: var(--temu-text) !important;
    font-weight: 700 !important;
    font-size: 18px !important;
}

/* === Income Cards Grid === */
.text-center .card {
    border-radius: var(--temu-radius-sm) !important;
}

.text-center .card h5 {
    color: var(--temu-primary) !important;
    font-weight: 700 !important;
}

.text-center .card .text-secondary,
.text-center .card .text-mute {
    color: var(--temu-text-muted) !important;
}

/* === Agent Box (Revenue Scroll) === */
.agent_box {
    border-radius: var(--temu-radius) !important;
    background: var(--temu-card) !important;
}

.agent_box .card {
    box-shadow: none !important;
    border-radius: var(--temu-radius-sm) !important;
    margin-bottom: 8px !important;
    background: var(--temu-bg) !important;
}

.agent_box .card-body {
    padding: 10px 14px !important;
}

.agent_box .luck {
    color: var(--temu-primary) !important;
    font-weight: 700 !important;
}

.agent_box h6.font-weight-normal {
    color: var(--temu-text) !important;
    font-weight: 600 !important;
}

.agent_box .border-left {
    border-left: 2px solid var(--temu-primary-light) !important;
}

/* === Footer Navigation === */
.footer {
    background: var(--temu-card) !important;
    box-shadow: 0 -1px 0 var(--temu-border), 0 -4px 20px rgba(0,0,0,0.04) !important;
    border-top: none !important;
}

.footer .col a,
.footer .col-3 a {
    color: var(--temu-text-muted) !important;
    transition: color 0.2s;
}

.footer .col a.active,
.footer .col-3 a.active,
.footer .col a:hover,
.footer .col-3 a:hover {
    color: var(--temu-primary) !important;
}

.footer .material-icons {
    font-size: 24px !important;
}

.footer .active .material-icons {
    color: var(--temu-primary) !important;
}

/* === Form Elements === */
.form-control {
    border: 2px solid var(--temu-border) !important;
    border-radius: var(--temu-radius-sm) !important;
    padding: 12px 14px !important;
    font-size: 15px !important;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: var(--temu-card) !important;
}

.form-control:focus {
    border-color: var(--temu-primary) !important;
    box-shadow: 0 0 0 3px rgba(251, 111, 32, 0.12) !important;
}

select.form-control {
    border: 2px solid var(--temu-border) !important;
    border-radius: var(--temu-radius-sm) !important;
}

/* === Float Label === */
.float-label .form-control-label {
    color: var(--temu-text-muted) !important;
    font-size: 13px !important;
}

/* === Notification === */
.notification {
    background: var(--temu-card) !important;
    border-radius: var(--temu-radius) !important;
    box-shadow: var(--temu-shadow) !important;
    border: none !important;
}

.notification .text-template {
    color: var(--temu-primary) !important;
}

/* === Swiper Banner === */
.swiper-container-banner {
    border-radius: 0 0 var(--temu-radius-lg) var(--temu-radius-lg) !important;
    overflow: hidden;
}

.swiper-container-banner img {
    border-radius: 0 0 var(--temu-radius-lg) var(--temu-radius-lg) !important;
}

/* === Partner Logo Slide === */
.news-slide .card {
    box-shadow: none !important;
    border: 1px solid var(--temu-border) !important;
    border-radius: var(--temu-radius-sm) !important;
    overflow: hidden;
}

/* === Service Button === */
.service-btn {
    background: var(--temu-primary) !important;
    box-shadow: 0 4px 14px rgba(251, 111, 32, 0.3) !important;
}

/* === Info Links Row === */
.container a.col-3 {
    text-decoration: none !important;
}

.container a.col-3 img {
    border-radius: var(--temu-radius-sm) !important;
    margin-bottom: 6px;
}

/* === Success/Danger Colors === */
.text-success {
    color: var(--temu-success) !important;
}

.text-danger {
    color: var(--temu-danger) !important;
}

.bg-success, .badge-success {
    background-color: var(--temu-success) !important;
}

/* === Tab Navigation === */
.nav-tabs {
    border-bottom: 2px solid var(--temu-border) !important;
}

.nav-tabs .nav-link {
    color: var(--temu-text-secondary) !important;
    border: none !important;
    font-weight: 600;
    padding: 10px 16px !important;
}

.nav-tabs .nav-link.active {
    color: var(--temu-primary) !important;
    border-bottom: 3px solid var(--temu-primary) !important;
    background: transparent !important;
}

/* === Badge === */
.badge-primary {
    background: var(--temu-primary) !important;
}

/* === Save/Submit Buttons === */
.save-btn {
    background: linear-gradient(135deg, var(--temu-primary), var(--temu-secondary)) !important;
    color: #FFFFFF !important;
    border: none !important;
    border-radius: 50px !important;
    font-weight: 600 !important;
    box-shadow: 0 4px 14px rgba(251, 111, 32, 0.3) !important;
}

/* === Border Left === */
.border-left-dotted {
    border-left: 2px dashed var(--temu-border) !important;
}

.border-left {
    border-left: 2px solid var(--temu-border) !important;
}

/* === Text Mute === */
.text-mute {
    opacity: 0.65;
}

/* === Progress Bar === */
.progress-bar {
    background: var(--temu-primary) !important;
    border-radius: 10px !important;
}

/* === Misc === */
.shadow {
    box-shadow: var(--temu-shadow) !important;
}

.shadow-sm {
    box-shadow: 0 1px 4px rgba(0,0,0,0.04) !important;
}

.border-0 {
    border: none !important;
}

.border-bottom {
    border-bottom: 1px solid var(--temu-border) !important;
}

/* === Swiper Dots === */
.swiper-pagination-bullet-active {
    background: var(--temu-primary) !important;
}

/* === Scrollbar Styling === */
::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--temu-border);
    border-radius: 4px;
}

/* === Rot Order Page - Grab Orders Button === */
.btn-important {
    width: 100%;
    text-transform: none !important;
    letter-spacing: 0.5px;
    /* Override the orange gradient - use a deep red/crimson that contrasts with orange theme */
    background: linear-gradient(135deg, #D4232A, #F73C1A) !important;
    color: #FFFFFF !important;
    font-weight: 700 !important;
    font-size: 18px !important;
    padding: 16px 24px !important;
    border: 2px solid rgba(255,255,255,0.3) !important;
    border-radius: 50px !important;
    box-shadow: 0 6px 24px rgba(212, 35, 42, 0.45), 0 0 40px rgba(251, 111, 32, 0.2) !important;
    text-shadow: 0 1px 3px rgba(0,0,0,0.2);
    min-height: 56px;
}

.btn-important:hover {
    background: linear-gradient(135deg, #B91C22, #D4232A) !important;
    box-shadow: 0 8px 30px rgba(212, 35, 42, 0.55), 0 0 50px rgba(251, 111, 32, 0.3) !important;
    transform: translateY(-2px) !important;
}

.btn-important:active {
    transform: translateY(0) !important;
}

/* === Level/VIP Badge === */
.vip-badge {
    background: linear-gradient(135deg, #FFB800, #FF8F00) !important;
    color: #FFF !important;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

/* === Wallet/Recharge Page Cards === */
.container > .card {
    margin-bottom: 12px !important;
}

/* === Animation Enhancements === */
@keyframes temu-pulse {
    0% { box-shadow: 0 6px 24px rgba(212, 35, 42, 0.45), 0 0 0 0 rgba(212, 35, 42, 0.5); }
    50% { box-shadow: 0 6px 24px rgba(212, 35, 42, 0.45), 0 0 0 12px rgba(212, 35, 42, 0); }
    100% { box-shadow: 0 6px 24px rgba(212, 35, 42, 0.45), 0 0 0 0 rgba(212, 35, 42, 0); }
}

.btn-important {
    animation: temu-pulse 2s infinite;
}

/* === Deposit/Withdraw Amount Grid === */
.amount-grid .btn {
    border: 2px solid var(--temu-border) !important;
    border-radius: var(--temu-radius-sm) !important;
    color: var(--temu-text) !important;
    background: var(--temu-card) !important;
    font-weight: 600 !important;
    margin: 4px;
    transition: all 0.2s;
}

.amount-grid .btn:hover,
.amount-grid .btn.active {
    border-color: var(--temu-primary) !important;
    color: var(--temu-primary) !important;
    background: var(--temu-primary-light) !important;
}

/* === Detail Page Headers === */
.header.bg-template {
    background: linear-gradient(135deg, var(--temu-primary), var(--temu-secondary)) !important;
}

.header.bg-template .btn-link {
    color: #FFFFFF !important;
}

.header.bg-template .material-icons {
    color: #FFFFFF !important;
}

/* === My Menu List === */
.container .card .list-group-item {
    border: none !important;
    border-bottom: 1px solid var(--temu-border) !important;
    padding: 14px 16px !important;
}

.container .card .list-group-item:last-child {
    border-bottom: none !important;
}

.container .card .list-group-item .material-icons {
    color: var(--temu-primary) !important;
}

/* === Closed Sidebar Menu === */
.closesidemenu .material-icons {
    color: var(--temu-text) !important;
}

/* === Custom Ripple Effect === */
.ripple {
    position: relative;
    overflow: hidden;
}

.ripple::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(251, 111, 32, 0.15);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.4s, height 0.4s;
}

.ripple:active::after {
    width: 200px;
    height: 200px;
}

/* === Container Padding === */
.container {
    padding-left: 16px !important;
    padding-right: 16px !important;
}

/* === Top Spacing === */
.top-50 {
    margin-top: -30px !important;
    position: relative !important;
    z-index: 2 !important;
}

.top-100 {
    margin-top: 16px !important;
}

/* === Fix for deep purple theme override === */
.deeppurple-theme .bg-template {
    background: linear-gradient(135deg, var(--temu-primary), var(--temu-secondary)) !important;
}

.deeppurple-theme .text-template {
    color: var(--temu-primary) !important;
}

/* === Toast/Dialog Override === */
.layui-m-layer0 .layui-m-layerchild {
    border-radius: var(--temu-radius) !important;
}

/* === Login Page Specific === */
.login-container .input-field:focus {
    border-color: var(--temu-primary) !important;
    box-shadow: 0 0 0 3px rgba(251, 111, 32, 0.12) !important;
}

.login-container .btn-primary,
.login-container button[type="submit"] {
    background: linear-gradient(135deg, var(--temu-primary), var(--temu-secondary)) !important;
    border: none !important;
    border-radius: 50px !important;
    font-weight: 600 !important;
    box-shadow: 0 4px 14px rgba(251, 111, 32, 0.3) !important;
}

/* === Tag/Chip Style === */
.chip {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    background: var(--temu-primary-light);
    color: var(--temu-primary);
}

/* === Fix Recharge & Withdraw Overlap === */
.icon-slide .swiper-slide a {
    display: block !important;
    text-decoration: none !important;
}

/* Ensure proper spacing between sections */
.container.top-50 + .container {
    padding-top: 4px !important;
}

.btn-important {
    margin-bottom: 4px !important;
    position: relative !important;
    z-index: 5 !important;
}