/* ============================================
   BHD Woo Wallet - Adaptive Layout Styles
   Compatible with both sidebar and non-sidebar themes
   ============================================ */

/* My Account Page - No background for cleaner look */
.woocommerce-account .woocommerce {
    padding: 20px 0 !important;
}

/* ============================================
   FORCE 2-COLUMN LAYOUT (25% + 75%)
   Works on ALL themes
   ============================================ */

/* Make WooCommerce container flexbox */
.woocommerce-account .woocommerce {
    display: flex !important;
    gap: 24px !important;
    max-width: 1400px !important;
    margin: 0 auto !important;
    align-items: flex-start !important;
}

/* Navigation sidebar - ALWAYS 25% */
.woocommerce-account .woocommerce-MyAccount-navigation {
    width: 25% !important;
    min-width: 280px !important;
    max-width: 320px !important;
    flex-shrink: 0 !important;
    position: sticky !important;
    top: 50px !important;
}

/* Content area - ALWAYS 75% */
.woocommerce-account .woocommerce-MyAccount-content {
    flex: 1 !important;
    width: auto !important;
    float: none !important;
}

/* Responsive: Stack on tablet/mobile */
@media (max-width: 1024px) {
    .woocommerce-account .woocommerce {
        flex-direction: column !important;
    }

    .woocommerce-account .woocommerce-MyAccount-navigation {
        width: 100% !important;
        max-width: none !important;
        position: relative !important;
        top: 0 !important;
    }
}

/* Profile Card - One Piece Style */
.bhd-profile-card {
    position: relative !important;
    background: var(--bhd-bg-card) !important;
    border-radius: 16px !important;
    padding: 24px !important;
    margin-bottom: 24px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15), 0 0 20px rgba(0, 0, 0, 0.1) !important;
    border: none !important;
    text-align: center !important;
    overflow: visible !important;
    /* Need visible for border animation */
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

/* Animated Border - One Piece Style */
.bhd-profile-card::before {
    content: '' !important;
    position: absolute !important;
    inset: -3px !important;
    /* Extend 3px outside for border effect */
    border-radius: 16px !important;
    padding: 3px !important;
    background: linear-gradient(45deg,
            #ffd700,
            #ff6b6b,
            #4ecdc4,
            #45b7d1,
            #ffd700) !important;
    background-size: 300% 300% !important;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0) !important;
    -webkit-mask-composite: xor !important;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0) !important;
    mask-composite: exclude !important;
    z-index: -1 !important;
    animation: borderAnimation 4s ease infinite !important;
}

@keyframes borderAnimation {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

/* Background Image Layer */
.bhd-profile-bg {
    position: absolute !important;
    inset: 0 !important;
    background-size: cover !important;
    background-position: center !important;
    opacity: var(--bg-opacity, 0.2) !important;
    z-index: 0 !important;
    border-radius: 16px !important;
}

/* Content Overlay */
.bhd-profile-content {
    position: relative !important;
    z-index: 1 !important;
}

/* Profile Card Title */
.bhd-profile-card h2,
.bhd-profile-card h3 {
    font-size: 18px !important;
    font-weight: 700 !important;
    color: #111827 !important;
    margin: 0 0 20px 0 !important;
}

/* Profile Card Content */
.bhd-profile-card p {
    font-size: 14px !important;
    color: #6B7280 !important;
    line-height: 1.6 !important;
    margin: 0 0 12px 0 !important;
}

.bhd-profile-card p:last-child {
    margin-bottom: 0 !important;
}

/* Profile Card Balance Amount */
.bhd-profile-card .bhd-balance-amount,
.bhd-profile-card .balance-amount {
    font-size: 1.6rem !important;
    font-weight: 700 !important;
    color: #D6546D !important;
    margin: 0 !important;
}

/* ============================================
   ADAPTIVE SIDEBAR WRAPPER
   Auto-detects sidebar vs full-width layout
   ============================================ */

/* Sidebar wrapper - ALWAYS 25% like navigation */
.bhd-sidebar-wrapper {
    width: 25% !important;
    min-width: 280px !important;
    max-width: 320px !important;
    box-sizing: border-box !important;
    /* overflow: hidden removed to show full border animation */
    position: sticky !important;
    top: 25px !important;
    align-self: flex-start !important;
}

/* Profile card fills sidebar wrapper */
.bhd-sidebar-wrapper .bhd-profile-card {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

/* Mobile: Full width */
@media (max-width: 768px) {
    .bhd-sidebar-wrapper {
        width: 100% !important;
        max-width: none !important;
        min-width: 0 !important;
    }
}

/* ============================================
   PROFILE CARD COMPONENTS
   ============================================ */

/* Profile Header */
.bhd-profile-header {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    margin-bottom: 16px !important;
    text-align: left !important;
}

.bhd-profile-info {
    flex: 1 !important;
    text-align: left !important;
}

.bhd-greeting {
    display: block !important;
    font-size: 13px !important;
    color: #6B7280 !important;
    margin-bottom: 2px !important;
}

.bhd-username {
    display: block !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    color: #111827 !important;
}

/* Profile Balance Section */
.bhd-profile-balance {
    padding-top: 12px !important;
    border-top: 1px solid #E5E7EB !important;
    margin-top: 12px !important;
}

.bhd-profile-balance .bhd-balance-label {
    display: block !important;
    font-size: 12px !important;
    color: #6B7280 !important;
    margin-bottom: 4px !important;
}

/* Profile Card Form Elements */
.bhd-profile-card input[type="text"],
.bhd-profile-card input[type="email"],
.bhd-profile-card input[type="password"],
.bhd-profile-card textarea,
.bhd-profile-card select {
    width: 100% !important;
    padding: 12px 16px !important;
    border: 1px solid #D1D5DB !important;
    border-radius: 8px !important;
    font-size: 14px !important;
    color: #111827 !important;
    background: white !important;
    transition: all 0.2s !important;
}

.bhd-profile-card input:focus,
.bhd-profile-card textarea:focus,
.bhd-profile-card select:focus {
    outline: none !important;
    border-color: #D6546D !important;
    box-shadow: 0 0 0 3px rgba(214, 84, 109, 0.1) !important;
}

/* Profile Card Buttons */
.bhd-profile-card button,
.bhd-profile-card .button {
    padding: 10px 24px !important;
    border-radius: 8px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    border: none !important;
    cursor: pointer !important;
    transition: all 0.2s !important;
    background: #D6546D !important;
    color: white !important;
}

.bhd-profile-card button:hover,
.bhd-profile-card .button:hover {
    background: #C04458 !important;
}

.bhd-profile-card button.secondary,
.bhd-profile-card .button.secondary {
    background: white !important;
    color: #374151 !important;
    border: 1px solid #E5E7EB !important;
}

.bhd-profile-card button.secondary:hover,
.bhd-profile-card .button.secondary:hover {
    background: #F9FAFB !important;
}

/* Sidebar Container */
.woocommerce-MyAccount-navigation {
    background-color: #FFFFFF !important;
    border-radius: 12px !important;
    padding: 20px 16px !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important;
    margin-bottom: 0 !important;
    border: none !important;
}

/* When navigation is inside sidebar wrapper, match parent width */
.bhd-sidebar-wrapper .woocommerce-MyAccount-navigation {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

/* Reset list styles */
.woocommerce-MyAccount-navigation ul {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.woocommerce-MyAccount-navigation ul li {
    margin: 0 0 4px 0 !important;
    padding: 0 !important;
    border: none !important;
    background: none !important;
    list-style: none !important;
}

/* Menu links */
.woocommerce-MyAccount-navigation ul li a {
    display: flex !important;
    align-items: center !important;
    padding: 10px 12px !important;
    border-radius: 8px !important;
    color: #6B7280 !important;
    text-decoration: none !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    line-height: 1.5 !important;
    transition: all 0.15s ease !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

/* Hover state - multiple selectors for theme compatibility */
.woocommerce-account .woocommerce-MyAccount-navigation ul li a:hover,
body.bhd-wallet-page .woocommerce-MyAccount-navigation ul li a:hover,
body .woocommerce-MyAccount-navigation ul li a:hover {
    background-color: rgba(214, 84, 109, 0.05) !important;
    color: #D6546D !important;
}

/* Active state - higher specificity to override theme */
.woocommerce-account .woocommerce-MyAccount-navigation ul li.is-active a,
body.bhd-wallet-page .woocommerce-MyAccount-navigation ul li.is-active a,
body .woocommerce-MyAccount-navigation ul li.is-active a,
.bhd-sidebar-wrapper .woocommerce-MyAccount-navigation ul li.is-active a {
    background-color: rgba(214, 84, 109, 0.1) !important;
    color: #D6546D !important;
    font-weight: 600 !important;
}

/* Icons using dashicons (WordPress default) */
.woocommerce-MyAccount-navigation ul li a::before,
.dashboard-links li a::before,
.nav-dropdown li a::before {
    font-family: 'dashicons' !important;
    font-size: 20px !important;
    width: 20px !important;
    height: 20px !important;
    margin-right: 12px !important;
    display: inline-block !important;
    line-height: 1 !important;
    vertical-align: middle !important;
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
}

/* Icon mappings */
.woocommerce-MyAccount-navigation-link--dashboard a::before,
.dashboard-links .woocommerce-MyAccount-navigation-link--dashboard a::before,
.nav-dropdown .woocommerce-MyAccount-navigation-link--dashboard a::before {
    content: "\f239";
}

/* dashboard */
.woocommerce-MyAccount-navigation-link--orders a::before,
.dashboard-links .woocommerce-MyAccount-navigation-link--orders a::before,
.nav-dropdown .woocommerce-MyAccount-navigation-link--orders a::before {
    content: "\f174";
}

/* cart */
.woocommerce-MyAccount-navigation-link--downloads a::before,
.dashboard-links .woocommerce-MyAccount-navigation-link--downloads a::before,
.nav-dropdown .woocommerce-MyAccount-navigation-link--downloads a::before {
    content: "\f316";
}

/* download */
.woocommerce-MyAccount-navigation-link--edit-address a::before,
.dashboard-links .woocommerce-MyAccount-navigation-link--edit-address a::before,
.nav-dropdown .woocommerce-MyAccount-navigation-link--edit-address a::before {
    content: "\f230";
}

/* location */
.woocommerce-MyAccount-navigation-link--edit-account a::before,
.dashboard-links .woocommerce-MyAccount-navigation-link--edit-account a::before,
.nav-dropdown .woocommerce-MyAccount-navigation-link--edit-account a::before {
    content: "\f110";
}

/* admin-users */
.woocommerce-MyAccount-navigation-link--customer-logout a::before,
.dashboard-links .woocommerce-MyAccount-navigation-link--customer-logout a::before,
.nav-dropdown .woocommerce-MyAccount-navigation-link--customer-logout a::before {
    content: "\f158";
    color: #DC2626 !important;
}

/* exit */

/* Custom wallet items */
.woocommerce-MyAccount-navigation-link--bhd-topup a::before,
.dashboard-links .woocommerce-MyAccount-navigation-link--bhd-topup a::before,
.nav-dropdown .woocommerce-MyAccount-navigation-link--bhd-topup a::before {
    content: "\f502";
}

/* money-alt */
.woocommerce-MyAccount-navigation-link--bhd-topup-history a::before,
.dashboard-links .woocommerce-MyAccount-navigation-link--bhd-topup-history a::before,
.nav-dropdown .woocommerce-MyAccount-navigation-link--bhd-topup-history a::before {
    content: "\f345";
}

/* backup */
.woocommerce-MyAccount-navigation-link--bhd-ledger a::before,
.dashboard-links .woocommerce-MyAccount-navigation-link--bhd-ledger a::before,
.nav-dropdown .woocommerce-MyAccount-navigation-link--bhd-ledger a::before {
    content: "\f180";
}

/* list-view */
.woocommerce-MyAccount-navigation-link--bhd-purchased a::before,
.dashboard-links .woocommerce-MyAccount-navigation-link--bhd-purchased a::before,
.nav-dropdown .woocommerce-MyAccount-navigation-link--bhd-purchased a::before {
    content: "\f322";
}

/* products */

/* Logout special styling */
.woocommerce-MyAccount-navigation-link--customer-logout a {
    color: #DC2626 !important;
}

.woocommerce-MyAccount-navigation-link--customer-logout a:hover {
    background-color: #FEF2F2 !important;
}

/* Topup highlight */
.woocommerce-MyAccount-navigation-link--bhd-topup.is-active a {
    background-color: #D6546D !important;
    color: white !important;
}

.woocommerce-MyAccount-navigation-link--bhd-topup.is-active a::before {
    color: white !important;
}

/* Profile Avatar */
.bhd-profile-avatar {
    width: 64px !important;
    height: 64px !important;
    border-radius: 50% !important;
    overflow: visible !important;
    flex-shrink: 0;
    position: relative !important;
}

.bhd-profile-avatar img.avatar {
    border-radius: 50% !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    position: relative !important;
    z-index: 2 !important;
}

/* Avatar Frame Overlay */
.bhd-avatar-frame {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    z-index: 4 !important;
    pointer-events: none !important;
    border-radius: 0 !important;
}

/* Avatar Glow Effect - Enhanced */
.bhd-avatar-glow {
    position: absolute !important;
    inset: -8px !important;
    border-radius: 50% !important;
    background: linear-gradient(var(--rank-gradient)) !important;
    filter: blur(12px) !important;
    opacity: 0.7 !important;
    z-index: 1 !important;
    animation: pulse-glow 2s ease-in-out infinite !important;
}

/* Rank-specific gradients */
[data-rank="rookie"] {
    --rank-gradient: 135deg, #4ade80, #22c55e;
    --rank-glow: rgba(74, 222, 128, 0.5);
}

[data-rank="fighter"] {
    --rank-gradient: 135deg, #60a5fa, #3b82f6;
    --rank-glow: rgba(96, 165, 250, 0.5);
}

[data-rank="captain"] {
    --rank-gradient: 135deg, #a78bfa, #8b5cf6;
    --rank-glow: rgba(167, 139, 250, 0.5);
}

[data-rank="shichibukai"] {
    --rank-gradient: 135deg, #f472b6, #ec4899;
    --rank-glow: rgba(244, 114, 182, 0.5);
}

[data-rank="yonko"] {
    --rank-gradient: 135deg, #fbbf24, #f59e0b;
    --rank-glow: rgba(251, 191, 36, 0.5);
}

/* Rank Badge - Enhanced */
.bhd-profile-card .bhd-rank-badge {
    display: inline-block !important;
    padding: 8px 20px !important;
    background: linear-gradient(var(--rank-gradient)) !important;
    border-radius: 20px !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    letter-spacing: 0.8px !important;
    margin: 12px 0 8px 0 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3), 0 0 20px var(--rank-glow) !important;
    color: white !important;
    text-align: center !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5) !important;
}

/* Rank Progress */
.bhd-profile-card .bhd-rank-progress {
    font-size: 11px !important;
    color: #6B7280 !important;
    margin: 0 0 12px 0 !important;
    line-height: 1.4 !important;
    text-align: center !important;
}

/* Pulse Glow Animation */
@keyframes pulse-glow {

    0%,
    100% {
        opacity: 0.5;
        transform: scale(1);
    }

    50% {
        opacity: 0.7;
        transform: scale(1.05);
    }
}

/* ============================================
   RANK PROMOTION BADGE
   ============================================ */

.bhd-rank-promotion-badge {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    margin-top: 12px !important;
    padding: 12px 14px !important;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.12), rgba(255, 165, 0, 0.12)) !important;
    border-left: 3px solid #FFD700 !important;
    border-radius: 10px !important;
    animation: slideInBadge 0.4s ease-out !important;
}

.promotion-badge-icon {
    font-size: 24px !important;
    line-height: 1 !important;
    flex-shrink: 0 !important;
    animation: bounceIcon 0.6s ease-out !important;
}

.promotion-badge-content {
    flex: 1 !important;
}

.promotion-badge-title {
    font-size: 13px !important;
    font-weight: 600 !important;
    color: #D97706 !important;
    margin-bottom: 3px !important;
    line-height: 1.3 !important;
}

.promotion-badge-bonus {
    font-size: 12px !important;
    font-weight: 500 !important;
    color: #92400E !important;
}

/* Animations */
@keyframes slideInBadge {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes bounceIcon {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.15);
    }
}
