/* ========================================
   BILLING PAGE V2 - STUNNING DESIGN
   ======================================== */

/* Layout */

body {
    background: var(--bg-primary);
    background-image: 
        radial-gradient(circle 600px at 15% 20%, rgba(242, 207, 123, 0.06) 0%, transparent 100%),
        radial-gradient(circle 450px at 85% 80%, rgba(125, 63, 38, 0.06) 0%, transparent 100%),
        radial-gradient(circle 350px at 50% 50%, rgba(168, 107, 236, 0.03) 0%, transparent 100%);
    background-attachment: fixed;
}

.billing-layout {
    display: flex;
    min-height: calc(100vh - 80px);
    max-width: 1600px;
    width: 100%;
    margin: 0 auto;
    padding: 3rem 3rem;
    position: relative;
    z-index: 1;
    gap: 2.5rem;
}

.billing-sidebar {
    width: 300px;
    flex-shrink: 0;
    padding: 2.5rem 1.5rem;
    background: rgba(15, 12, 10, 0.4);
    backdrop-filter: blur(20px);
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 20px;
    height: fit-content;
    position: sticky;
    top: 100px;
}

.billing-content {
    flex: 1;
    padding: 0;
    overflow-y: auto;
    min-width: 0;
}

/* Sidebar Header */
.billing-sidebar .sidebar-header {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.billing-sidebar .sidebar-header h2 {
    font-family: 'Quicksand', sans-serif;
    font-size: 1.75rem;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.billing-sidebar .sidebar-header p {
    color: var(--text-secondary);
    font-size: 15px;
}

/* Sidebar Navigation */
.billing-sidebar .sidebar-nav {
    margin-top: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.billing-sidebar .sidebar-nav-item {
    font-family: 'Quicksand', sans-serif;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 15px;
    border-radius: 14px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    background: transparent;
    border: none;
    cursor: pointer;
    text-align: left;
    width: 100%;
}

.billing-sidebar .sidebar-nav-item::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(242, 207, 123, 0.1) 0%, rgba(125, 63, 38, 0.1) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none; /* Allow clicks to pass through */
}

.billing-sidebar .sidebar-nav-item:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.04);
    transform: translateX(6px);
}

.billing-sidebar .sidebar-nav-item:hover::before {
    opacity: 1;
}

.billing-sidebar .sidebar-nav-item.active {
    font-family: 'Quicksand', sans-serif;
    color: var(--accent-gold);
    background: linear-gradient(135deg, rgba(242, 207, 123, 0.12) 0%, rgba(125, 63, 38, 0.08) 100%);
    border: 1px solid rgba(242, 207, 123, 0.2);
    box-shadow: 0 4px 20px rgba(242, 207, 123, 0.15);
}

.billing-sidebar .sidebar-nav-item.active::after {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 60%;
    background: var(--gradient-primary);
    border-radius: 0 4px 4px 0;
    box-shadow: 0 0 12px rgba(242, 207, 123, 0.6);
}

.billing-sidebar .sidebar-nav-item svg {
    stroke: currentColor;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* Content Area & Tabs */
.billing-content {
    position: relative;
}

.billing-tab {
    display: none;
}

.billing-tab.active {
    display: block;
    animation: fadeInUp 0.5s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Tab Header */
.tab-header {
    margin-bottom: 2rem;
}

.tab-title {
    font-family: 'Quicksand', sans-serif;
    font-size: 2.5rem;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

.tab-subtitle {
    font-size: 16px;
    color: var(--text-secondary);
}

/* Billing Cards */
.billing-card {
    background: var(--bg-card);
    backdrop-filter: blur(30px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: var(--shadow-card);
    margin-bottom: 2rem;
    transition: all 0.4s ease;
}

.billing-card:hover {
    transform: translateY(-4px);
    border-color: rgba(242, 207, 123, 0.2);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

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

.card-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.btn-text {
    padding: 8px 16px;
    background: rgba(168, 107, 62, 0.15);
    border: 1px solid rgba(168, 107, 62, 0.3);
    border-radius: 8px;
    color: #d4a574;
    font-size: 14px;
    font-weight: 600;
    font-family: 'Quicksand', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-text:hover {
    background: rgba(168, 107, 62, 0.25);
    border-color: rgba(212, 165, 116, 0.5);
    color: #f2cf7b;
}

/* Plan Badges */
.plan-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.plan-badge-active,
.plan-badge-current {
    background: rgba(34, 197, 94, 0.2);
    border: 1px solid rgba(34, 197, 94, 0.4);
    color: #22c55e;
}

.plan-badge-pro {
    background: linear-gradient(135deg, rgba(242, 207, 123, 0.3) 0%, rgba(212, 165, 116, 0.3) 100%);
    border: 1px solid #f2cf7b;
    color: #fff;
}

/* Plan Overview */
.plan-overview {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    margin-bottom: 1.75rem;
}

.plan-overview-left {
    display: flex;
    gap: 20px;
    align-items: center;
    flex: 1;
}

.plan-icon-large {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(168, 107, 62, 0.2);
    border: 1px solid rgba(212, 165, 116, 0.4);
    border-radius: 16px;
    color: #d4a574;
    flex-shrink: 0;
}

.plan-overview-info h2 {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.plan-price-display {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 8px;
}

.plan-price-display .price {
    font-size: 2rem;
    font-weight: 800;
    color: var(--accent-gold);
}

.plan-price-display .period {
    font-size: 14px;
    color: var(--text-secondary);
}

.plan-overview-info p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.lifetime-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(34, 197, 94, 0.15);
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: 8px;
    color: #22c55e;
    font-size: 13px;
    font-weight: 600;
}

.btn-upgrade {
    padding: 14px 24px;
    background: linear-gradient(135deg, #f2cf7b 0%, #d29658 70%, #7d3f26 100%);
    border: none;
    border-radius: 12px;
    color: #0a0a0a;
    font-size: 15px;
    font-weight: 700;
    font-family: 'Quicksand', sans-serif;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.btn-upgrade:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(242, 207, 123, 0.4);
}

/* Plan Features Grid */
.plan-features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.feature-mini {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: rgba(168, 107, 62, 0.05);
    border: 1px solid rgba(168, 107, 62, 0.15);
    border-radius: 10px;
    font-size: 14px;
    color: rgba(196, 181, 160, 0.9);
    transition: all 0.3s ease;
}

.feature-mini:hover {
    background: rgba(168, 107, 62, 0.1);
    border-color: rgba(212, 165, 116, 0.3);
}

.feature-mini svg {
    color: #22c55e;
    flex-shrink: 0;
}

/* Credits Overview */
.credits-overview {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 32px;
}

.credits-visual {
    display: flex;
    align-items: center;
    gap: 24px;
    flex: 1;
}

.credits-circle {
    position: relative;
    width: 100px;
    height: 100px;
}

.credits-circle svg {
    width: 100%;
    height: 100%;
}

.credits-number {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 32px;
    font-weight: 800;
    color: #a855f7;
}

.credits-info {
    flex: 1;
}

.credits-label {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.credits-percentage {
    font-size: 14px;
    color: var(--text-secondary);
}

.btn-secondary {
    padding: 14px 24px;
    background: rgba(168, 107, 62, 0.3);
    border: 1.5px solid rgba(212, 165, 116, 0.5);
    border-radius: 12px;
    color: #f2cf7b;
    font-size: 15px;
    font-weight: 700;
    font-family: 'Quicksand', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.btn-secondary:hover {
    background: rgba(168, 107, 62, 0.4);
    border-color: rgba(242, 207, 123, 0.7);
    transform: translateY(-2px);
}

/* Plans Grid */
.plans-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
    margin-bottom: 24px;
}

/* Plan Cards */
.plan-card {
    position: relative;
    background: linear-gradient(135deg, rgba(20, 20, 24, 0.95) 0%, rgba(24, 24, 30, 0.92) 100%);
    border: 1px solid rgba(242, 207, 123, 0.15);
    border-radius: 24px;
    padding: 2.5rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.plan-card:hover {
    transform: translateY(-5px);
    border-color: rgba(242, 207, 123, 0.3);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3), 0 0 60px rgba(242, 207, 123, 0.1);
}

.plan-card.plan-disabled {
    opacity: 0.4;
    pointer-events: none;
    filter: grayscale(60%);
    border-color: rgba(168, 107, 62, 0.15);
}

.plan-card.plan-disabled:hover {
    transform: none;
    border-color: rgba(168, 107, 62, 0.15);
    box-shadow: none;
}

.plan-card.plan-current {
    border: 2px solid rgba(34, 197, 94, 0.5);
}

.plan-card.plan-featured {
    border-color: rgba(168, 85, 247, 0.3);
}

.plan-card.plan-featured:hover {
    border-color: rgba(168, 85, 247, 0.6);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3), 0 0 60px rgba(168, 85, 247, 0.2);
}

.plan-glow {
    position: absolute;
    inset: -100%;
    background: radial-gradient(circle, rgba(242, 207, 123, 0.15) 0%, transparent 70%);
    animation: glowPulse 3s ease-in-out infinite;
    pointer-events: none;
}

@keyframes glowPulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

.plan-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 2;
}

.plan-header {
    margin-bottom: 24px;
}

.plan-icon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(168, 107, 62, 0.2);
    border: 1px solid rgba(212, 165, 116, 0.3);
    border-radius: 14px;
    color: #d4a574;
    margin-bottom: 16px;
}

.plan-icon-pro {
    background: linear-gradient(135deg, rgba(242, 207, 123, 0.2) 0%, rgba(212, 165, 116, 0.2) 100%);
    border-color: rgba(242, 207, 123, 0.5);
    color: #f2cf7b;
}

.plan-name {
    font-size: 24px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.plan-price {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 8px;
}

.price-amount {
    font-size: 40px;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.price-period {
    font-size: 14px;
    color: var(--text-secondary);
}

.upgrade-price {
    display: inline-block;
    padding: 6px 12px;
    background: rgba(34, 197, 94, 0.2);
    border: 1px solid rgba(34, 197, 94, 0.4);
    border-radius: 8px;
    color: #22c55e;
    font-size: 13px;
    font-weight: 700;
}

.plan-features {
    margin-bottom: 24px;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    color: rgba(196, 181, 160, 0.9);
    font-size: 14px;
    border-bottom: 1px solid rgba(168, 107, 62, 0.1);
}

.feature-item:last-child {
    border-bottom: none;
}

.feature-item svg {
    color: #22c55e;
    flex-shrink: 0;
}

.feature-highlight {
    color: #f2cf7b;
    font-weight: 600;
}

.plan-button {
    width: 100%;
    padding: 14px 24px;
    background: rgba(168, 107, 62, 0.3);
    border: 1.5px solid rgba(212, 165, 116, 0.5);
    border-radius: 12px;
    color: #f2cf7b;
    font-size: 15px;
    font-weight: 700;
    font-family: 'Quicksand', sans-serif;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.plan-button:hover {
    background: rgba(168, 107, 62, 0.4);
    border-color: rgba(242, 207, 123, 0.7);
    transform: translateY(-2px);
}

.plan-button-current {
    background: rgba(34, 197, 94, 0.2);
    border-color: rgba(34, 197, 94, 0.4);
    color: #22c55e;
    cursor: not-allowed;
    opacity: 0.8;
}

.plan-button-current:hover {
    transform: none;
}

.plan-button-pro {
    background: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%);
    border: 1px solid rgba(168, 85, 247, 0.4);
    color: white;
}

.plan-button-pro:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(168, 85, 247, 0.4);
}

.plans-note {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
    padding: 16px;
    background: rgba(168, 107, 62, 0.1);
    border: 1px solid rgba(168, 107, 62, 0.2);
    border-radius: 12px;
    color: rgba(196, 181, 160, 0.8);
    font-size: 14px;
}

/* Credits Balance Card */
.credits-balance-card {
    background: var(--bg-card);
    backdrop-filter: blur(30px);
    border: 1px solid rgba(168, 85, 247, 0.3);
    border-radius: 20px;
    padding: 2rem;
    margin-bottom: 24px;
    transition: all 0.4s ease;
}

.credits-balance-card:hover {
    transform: translateY(-4px);
    border-color: rgba(168, 85, 247, 0.5);
    box-shadow: 0 20px 60px rgba(168, 85, 247, 0.2);
}

.credits-balance-info {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-bottom: 20px;
}

.credits-icon {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(168, 85, 247, 0.2);
    border: 1px solid rgba(168, 85, 247, 0.4);
    border-radius: 16px;
    color: #a855f7;
    font-size: 32px;
}

.credits-icon .material-symbols-rounded {
    font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 48;
}

.credits-text h3 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.credits-amount {
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.credits-amount .credits-number {
    font-size: 36px;
    font-weight: 800;
    color: #a855f7;
    line-height: 1;
}

.credits-amount .credits-label {
    font-size: 14px;
    color: var(--text-secondary);
}

.credits-progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(168, 85, 247, 0.15);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.credits-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #a855f7 0%, #c084fc 100%);
    border-radius: 4px;
    transition: width 0.6s ease;
}

.credits-progress-label {
    font-size: 13px;
    color: var(--text-secondary);
    text-align: right;
}

/* Credit Packs */
.credits-packs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.credit-pack-card {
    background: var(--bg-card);
    backdrop-filter: blur(30px);
    border: 1px solid rgba(168, 85, 247, 0.15);
    border-radius: 20px;
    padding: 2rem;
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.credit-pack-card:hover {
    transform: translateY(-5px);
    border-color: rgba(168, 85, 247, 0.3);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3), 0 0 60px rgba(168, 85, 247, 0.1);
}

.credit-pack-featured {
    border: 1px solid rgba(168, 85, 247, 0.4);
    background: linear-gradient(135deg, rgba(20, 20, 24, 0.95) 0%, rgba(24, 24, 30, 0.92) 100%);
}

.credit-pack-glow {
    position: absolute;
    inset: -100%;
    background: radial-gradient(circle, rgba(168, 85, 247, 0.15) 0%, transparent 70%);
    animation: glowPulse 3s ease-in-out infinite;
    pointer-events: none;
}

.credit-pack-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    padding: 6px 12px;
    background: rgba(168, 85, 247, 0.15);
    border: 1px solid rgba(168, 85, 247, 0.3);
    border-radius: 8px;
    color: #a855f7;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    z-index: 2;
    letter-spacing: 0.5px;
}

.credit-pack-badge-pro {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.3) 0%, rgba(212, 165, 116, 0.3) 100%);
    border: 1px solid #a855f7;
    color: #fff;
}

.credit-pack-header {
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.credit-pack-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(168, 85, 247, 0.15);
    border: 1px solid rgba(168, 85, 247, 0.3);
    border-radius: 12px;
    color: #a855f7;
    margin-bottom: 1rem;
}

.credit-pack-icon .material-symbols-rounded {
    font-size: 28px;
    font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 48;
}

.credit-pack-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    font-family: 'Outfit', sans-serif;
}

.credit-pack-description {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.5;
    min-height: 2.5em;
}

.credit-pack-savings {
    display: inline-block;
    padding: 4px 10px;
    background: rgba(34, 197, 94, 0.15);
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: 6px;
    color: #22c55e;
    font-size: 12px;
    font-weight: 700;
    margin-top: 0.5rem;
}

.credit-pack-price {
    margin-bottom: 1.5rem;
}

.pack-price-amount {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, #a855f7 0%, #c084fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
    display: block;
    margin-bottom: 4px;
    font-family: 'Outfit', sans-serif;
}

.pack-price-onetime {
    font-size: 11px;
    color: #f2cf7b;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.8;
    display: block;
    margin-bottom: 4px;
}

.pack-price-per {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.credit-pack-features {
    margin-bottom: 2rem;
    flex-grow: 1;
}

.pack-feature {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    color: rgba(196, 181, 160, 0.9);
    font-size: 0.95rem;
}

.pack-feature svg {
    color: #a855f7;
    flex-shrink: 0;
}

.credit-pack-button {
    width: 100%;
    padding: 14px 24px;
    background: rgba(168, 85, 247, 0.1);
    border: 1px solid rgba(168, 85, 247, 0.3);
    border-radius: 12px;
    color: #a855f7;
    font-size: 1rem;
    font-weight: 700;
    font-family: 'Quicksand', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: auto;
}

.credit-pack-button:hover {
    background: rgba(168, 85, 247, 0.2);
    border-color: rgba(168, 85, 247, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(168, 85, 247, 0.2);
}

.credit-pack-button-featured {
    background: linear-gradient(135deg, #a855f7 0%, #c084fc 100%);
    border: none;
    color: #fff;
}

.credit-pack-button-featured:hover {
    background: linear-gradient(135deg, #9333ea 0%, #a855f7 100%);
    box-shadow: 0 8px 30px rgba(168, 85, 247, 0.4);
    color: #fff;
    opacity: 1;
}

/* Credit Usage Section */
.usage-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.usage-card {
    background: var(--bg-card);
    backdrop-filter: blur(30px);
    border: 1px solid rgba(168, 85, 247, 0.15);
    border-radius: 18px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.usage-card:hover {
    border-color: rgba(168, 85, 247, 0.3);
    box-shadow: 0 8px 32px rgba(168, 85, 247, 0.15);
    transform: translateY(-2px);
}

.usage-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.12) 0%, rgba(192, 132, 252, 0.08) 100%);
    border: 1px solid rgba(168, 85, 247, 0.2);
    border-radius: 12px;
    color: #a855f7;
    flex-shrink: 0;
    margin-bottom: 0.5rem;
}

.usage-icon svg {
    width: 24px;
    height: 24px;
}

.usage-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: 100%;
}

.usage-info h4 {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1.4;
    min-height: 2.8em;
    display: flex;
    align-items: center;
    justify-content: center;
}

.usage-info p {
    display: none;
}

.usage-cost {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 4px;
    padding-top: 0;
    border-top: none;
    margin-top: auto;
}

.usage-cost .cost-value {
    font-family: 'Outfit', sans-serif;
    font-size: 1.75rem;
    font-weight: 800;
    background: linear-gradient(135deg, #a855f7 0%, #c084fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
}

.usage-cost .cost-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 600;
}

@media (max-width: 768px) {
    .usage-grid {
        grid-template-columns: 1fr;
    }
}

/* Purchase History */
.history-card {
    background: var(--bg-card);
    backdrop-filter: blur(30px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 2rem;
}

.history-item {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px;
    background: rgba(168, 107, 62, 0.05);
    border: 1px solid rgba(168, 107, 62, 0.15);
    border-radius: 12px;
    margin-bottom: 16px;
    transition: all 0.3s ease;
}

.history-item:hover {
    background: rgba(168, 107, 62, 0.1);
    border-color: rgba(212, 165, 116, 0.3);
    transform: translateX(4px);
}

.history-item-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(168, 107, 62, 0.2);
    border: 1px solid rgba(212, 165, 116, 0.3);
    border-radius: 12px;
    color: #d4a574;
    flex-shrink: 0;
}

.history-item-info {
    flex: 1;
}

.history-item-info h4 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.history-item-info p {
    font-size: 14px;
    color: var(--text-secondary);
}

.history-item-amount {
    font-size: 20px;
    font-weight: 700;
    color: var(--accent-gold);
    margin-right: 20px;
}

.history-item-receipt {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: rgba(168, 107, 62, 0.2);
    border: 1px solid rgba(212, 165, 116, 0.3);
    border-radius: 8px;
    color: #d4a574;
    font-size: 14px;
    font-weight: 600;
    font-family: 'Quicksand', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
}

.history-item-receipt:hover {
    background: rgba(168, 107, 62, 0.3);
    border-color: rgba(242, 207, 123, 0.5);
    color: #f2cf7b;
}

.history-item-invoice {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: rgba(168, 107, 62, 0.2);
    border: 1px solid rgba(212, 165, 116, 0.3);
    border-radius: 8px;
    color: #d4a574;
    font-size: 14px;
    font-weight: 600;
    font-family: 'Quicksand', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.history-item-invoice:hover {
    background: rgba(168, 107, 62, 0.3);
    border-color: rgba(242, 207, 123, 0.5);
    color: #f2cf7b;
}

.history-item-invoice:disabled {
    opacity: 0.7;
    cursor: wait;
}

.history-item-invoice svg.spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.history-item-icon.credits-icon {
    background: rgba(168, 85, 247, 0.2);
    border-color: rgba(168, 85, 247, 0.3);
    color: #a855f7;
}

.history-item-status {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    text-transform: capitalize;
}

.history-item-status.status-success {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
}

.history-item-status.status-error {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.history-item-status.status-pending {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.history-empty-note {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
    font-size: 14px;
}

/* ==========================================
   RESPONSIVE - Tablet & Mobile Optimizations
   ========================================== */

@media (max-width: 1024px) {
    .billing-layout {
        flex-direction: column;
        gap: 1.5rem;
    }
    
    .billing-sidebar {
        width: 100%;
        position: static;
    }
    
    .plan-overview {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .btn-upgrade {
        width: 100%;
        justify-content: center;
    }
}

/* ==========================================
   MOBILE OPTIMIZATIONS (<768px)
   ========================================== */
@media (max-width: 768px) {
    /* Layout - Compact padding */
    .billing-layout {
        padding: 1rem;
        gap: 1rem;
        min-height: auto;
    }
    
    /* Sidebar - Horizontal tabs on mobile */
    .billing-sidebar {
        padding: 6px;
        border-radius: 14px;
        background: rgba(15, 12, 10, 0.8);
        border: 1px solid rgba(255, 255, 255, 0.08);
    }
    
    .billing-sidebar .sidebar-header {
        display: none; /* Hide header on mobile */
    }
    
    .billing-sidebar .sidebar-nav {
        display: flex;
        flex-direction: row;
        gap: 4px;
        margin: 0;
    }
    
    .billing-sidebar .sidebar-nav-item {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 12px 6px;
        gap: 6px;
        border-radius: 10px;
        background: rgba(255, 255, 255, 0.03);
        border: 1px solid transparent;
        cursor: pointer;
        touch-action: manipulation;
        -webkit-tap-highlight-color: rgba(242, 207, 123, 0.2);
    }
    
    .billing-sidebar .sidebar-nav-item::before {
        display: none; /* Remove overlay on mobile */
    }
    
    .billing-sidebar .sidebar-nav-item svg {
        width: 20px;
        height: 20px;
        flex-shrink: 0;
        pointer-events: none;
    }
    
    .billing-sidebar .sidebar-nav-item span {
        font-size: 10px;
        font-weight: 600;
        line-height: 1.2;
        pointer-events: none;
    }
    
    .billing-sidebar .sidebar-nav-item:hover {
        transform: none;
    }
    
    .billing-sidebar .sidebar-nav-item.active {
        background: linear-gradient(135deg, rgba(242, 207, 123, 0.18) 0%, rgba(125, 63, 38, 0.12) 100%);
        border: 1px solid rgba(242, 207, 123, 0.35);
        color: var(--accent-gold);
        box-shadow: 0 2px 12px rgba(242, 207, 123, 0.2);
    }
    
    .billing-sidebar .sidebar-nav-item.active::after {
        display: none; /* Hide left bar indicator on mobile */
    }
    
    .billing-sidebar .sidebar-nav-item:active {
        transform: scale(0.96);
        opacity: 0.9;
    }
    
    /* Tab Header */
    .tab-header {
        margin-bottom: 1.25rem;
    }
    
    .tab-title {
        font-size: 1.75rem;
        margin-bottom: 0.25rem;
    }
    
    .tab-subtitle {
        font-size: 14px;
    }
    
    /* Billing Cards */
    .billing-card {
        padding: 1.25rem;
        border-radius: 16px;
        margin-bottom: 1rem;
    }
    
    .billing-card:hover {
        transform: none; /* Disable hover lift on mobile */
    }
    
    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding-bottom: 1rem;
        margin-bottom: 1rem;
    }
    
    .card-header-content {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .card-header h3 {
        font-size: 1.1rem;
    }
    
    .btn-text {
        padding: 6px 12px;
        font-size: 13px;
    }
    
    /* Plan Badge */
    .plan-badge {
        padding: 5px 10px;
        font-size: 11px;
    }
    
    /* Plan Overview */
    .plan-overview {
        flex-direction: column;
        gap: 16px;
        margin-bottom: 1.25rem;
    }
    
    .plan-overview-left {
        flex-direction: row;
        gap: 14px;
        width: 100%;
    }
    
    .plan-icon-large {
        width: 56px;
        height: 56px;
        border-radius: 12px;
    }
    
    .plan-icon-large svg {
        width: 32px;
        height: 32px;
    }
    
    .plan-overview-info h2 {
        font-size: 1.25rem;
        margin-bottom: 4px;
    }
    
    .plan-price-display {
        margin-bottom: 4px;
    }
    
    .plan-price-display .price {
        font-size: 1.5rem;
    }
    
    .plan-price-display .period {
        font-size: 12px;
    }
    
    .plan-overview-info p {
        font-size: 12px;
        margin-bottom: 8px;
    }
    
    .lifetime-tag {
        padding: 4px 10px;
        font-size: 11px;
    }
    
    .btn-upgrade {
        width: 100%;
        padding: 12px 20px;
        font-size: 14px;
        border-radius: 10px;
        justify-content: center;
    }
    
    /* Plan Features Grid */
    .plan-features-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .feature-mini {
        padding: 10px;
        font-size: 13px;
        border-radius: 8px;
    }
    
    .feature-mini svg {
        width: 16px;
        height: 16px;
    }
    
    /* Credits Overview */
    .credits-overview {
        flex-direction: column;
        gap: 16px;
    }
    
    .credits-visual {
        width: 100%;
        gap: 16px;
    }
    
    .credits-circle {
        width: 80px;
        height: 80px;
    }
    
    .credits-number {
        font-size: 24px;
    }
    
    .credits-label {
        font-size: 14px;
    }
    
    .credits-percentage {
        font-size: 12px;
    }
    
    .btn-secondary {
        width: 100%;
        padding: 12px 20px;
        font-size: 14px;
        border-radius: 10px;
        justify-content: center;
    }
    
    /* Plans Grid */
    .plans-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    /* Plan Cards */
    .plan-card {
        padding: 1.5rem;
        border-radius: 18px;
    }
    
    .plan-card:hover {
        transform: none;
    }
    
    .plan-badge {
        top: 12px;
        right: 12px;
    }
    
    .plan-header {
        margin-bottom: 16px;
    }
    
    .plan-icon {
        width: 44px;
        height: 44px;
        border-radius: 12px;
        margin-bottom: 12px;
    }
    
    .plan-icon svg {
        width: 24px;
        height: 24px;
    }
    
    .plan-name {
        font-size: 20px;
        margin-bottom: 8px;
    }
    
    .plan-price {
        margin-bottom: 6px;
    }
    
    .price-amount {
        font-size: 32px;
    }
    
    .price-period {
        font-size: 12px;
    }
    
    .upgrade-price {
        padding: 5px 10px;
        font-size: 12px;
    }
    
    .plan-features {
        margin-bottom: 16px;
    }
    
    .feature-item {
        padding: 8px 0;
        font-size: 13px;
        gap: 10px;
    }
    
    .feature-item svg {
        width: 16px;
        height: 16px;
    }
    
    .plan-button {
        padding: 12px 20px;
        font-size: 14px;
        border-radius: 10px;
    }
    
    .plans-note {
        padding: 12px;
        font-size: 12px;
        border-radius: 10px;
        text-align: center;
        flex-direction: column;
        gap: 6px;
    }
    
    /* Credits Balance Card */
    .credits-balance-card {
        padding: 1.25rem;
        border-radius: 16px;
        margin-bottom: 16px;
    }
    
    .credits-balance-card:hover {
        transform: none;
    }
    
    .credits-balance-info {
        gap: 16px;
        margin-bottom: 16px;
    }
    
    .credits-icon {
        width: 48px;
        height: 48px;
        border-radius: 12px;
        font-size: 24px;
    }
    
    .credits-text h3 {
        font-size: 16px;
        margin-bottom: 4px;
    }
    
    .credits-amount .credits-number {
        font-size: 28px;
    }
    
    .credits-amount .credits-label {
        font-size: 12px;
    }
    
    .credits-progress-bar {
        height: 6px;
        margin-bottom: 6px;
    }
    
    .credits-progress-label {
        font-size: 11px;
    }
    
    /* Credit Packs */
    .credits-packs {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .credit-pack-card {
        padding: 1.25rem;
        border-radius: 16px;
    }
    
    .credit-pack-card:hover {
        transform: none;
    }
    
    .credit-pack-badge {
        top: 12px;
        right: 12px;
        padding: 4px 10px;
        font-size: 10px;
    }
    
    .credit-pack-header {
        margin-bottom: 1rem;
    }
    
    .credit-pack-icon {
        width: 40px;
        height: 40px;
        border-radius: 10px;
        margin-bottom: 0.75rem;
    }
    
    .credit-pack-icon .material-symbols-rounded {
        font-size: 24px;
    }
    
    .credit-pack-title {
        font-size: 1.25rem;
    }
    
    .credit-pack-description {
        font-size: 0.85rem;
        margin-bottom: 1rem;
        min-height: auto;
    }
    
    .credit-pack-savings {
        padding: 3px 8px;
        font-size: 11px;
    }
    
    .credit-pack-price {
        margin-bottom: 1rem;
    }
    
    .pack-price-amount {
        font-size: 2rem;
    }
    
    .pack-price-per {
        font-size: 0.8rem;
    }
    
    .credit-pack-features {
        margin-bottom: 1.25rem;
    }
    
    .pack-feature {
        padding: 6px 0;
        font-size: 0.85rem;
        gap: 10px;
    }
    
    .pack-feature svg {
        width: 16px;
        height: 16px;
    }
    
    .credit-pack-button {
        padding: 12px 20px;
        font-size: 0.9rem;
        border-radius: 10px;
    }
    
    /* Usage Grid */
    .usage-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .usage-card {
        padding: 1rem;
        border-radius: 14px;
        gap: 0.75rem;
    }
    
    .usage-card:hover {
        transform: none;
    }
    
    .usage-icon {
        width: 40px;
        height: 40px;
        border-radius: 10px;
        margin-bottom: 0.25rem;
    }
    
    .usage-icon svg {
        width: 20px;
        height: 20px;
    }
    
    .usage-info h4 {
        font-size: 0.7rem;
        min-height: 2.4em;
    }
    
    .usage-cost .cost-value {
        font-size: 1.4rem;
    }
    
    .usage-cost .cost-label {
        font-size: 0.7rem;
    }
    
    /* Credits Note */
    .credits-note {
        padding: 1rem !important;
        font-size: 0.8rem !important;
        border-radius: 12px !important;
        gap: 0.75rem !important;
    }
    
    .credits-note svg {
        width: 18px !important;
        height: 18px !important;
    }
    
    /* History Card */
    .history-card {
        padding: 1rem;
        border-radius: 16px;
    }
    
    .history-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        padding: 14px;
        padding-top: 40px;
        border-radius: 10px;
        margin-bottom: 10px;
        position: relative;
    }
    
    .history-item:hover {
        transform: none;
    }
    
    .history-item-icon {
        width: 40px;
        height: 40px;
        border-radius: 10px;
    }
    
    .history-item-icon svg {
        width: 20px;
        height: 20px;
    }
    
    .history-item-info h4 {
        font-size: 14px;
    }
    
    .history-item-info p {
        font-size: 12px;
    }
    
    .history-item-amount {
        font-size: 18px;
        margin-right: 0;
        order: -1;
        align-self: flex-end;
        position: absolute;
        top: 14px;
        right: 14px;
    }
    
    .history-item-receipt,
    .history-item-invoice {
        width: 100%;
        justify-content: center;
        padding: 10px 14px;
        font-size: 13px;
        border-radius: 8px;
    }
    
    .history-item-status {
        position: absolute;
        top: 14px;
        left: 70px;
        padding: 4px 8px;
        font-size: 10px;
    }
    
    .history-empty-note {
        padding: 30px 16px;
        font-size: 13px;
    }
}

/* ==========================================
   EXTRA SMALL SCREENS (<380px)
   ========================================== */
@media (max-width: 380px) {
    .billing-layout {
        padding: 0.5rem;
    }
    
    .billing-sidebar {
        padding: 0.35rem;
    }
    
    .billing-sidebar .sidebar-nav-item {
        padding: 10px 6px;
    }
    
    .billing-sidebar .sidebar-nav-item span {
        font-size: 9px;
    }
    
    .billing-sidebar .sidebar-nav-item svg {
        width: 18px;
        height: 18px;
    }
    
    .tab-title {
        font-size: 1.5rem;
    }
    
    .billing-card {
        padding: 1rem;
    }
    
    .plan-overview-left {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .plan-icon-large {
        width: 48px;
        height: 48px;
    }
    
    .plan-icon-large svg {
        width: 28px;
        height: 28px;
    }
    
    .credits-visual {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .credits-circle {
        width: 70px;
        height: 70px;
    }
    
    .credits-number {
        font-size: 20px;
    }
    
    .usage-grid {
        grid-template-columns: 1fr;
    }
    
    .history-item-amount {
        position: static;
        order: 0;
        align-self: flex-start;
    }
}

/* Loading Spinner */
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(168, 107, 62, 0.2);
    border-top-color: #f2cf7b;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}
