/* ========================================
   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;
    overflow-x: hidden;
}

@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);
}

/* ========================================
   CURRENT STATUS SECTION
   ======================================== */

.current-status-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 28px;
}

/* Current Plan Mini Card */
.current-plan-mini {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px;
    background: rgba(20, 18, 15, 0.6);
    border: 1px solid rgba(242, 207, 123, 0.15);
    border-radius: 16px;
    backdrop-filter: blur(10px);
}

.current-plan-info {
    display: flex;
    align-items: center;
    gap: 14px;
}

.current-plan-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(242, 207, 123, 0.15) 0%, rgba(212, 165, 116, 0.1) 100%);
    border-radius: 12px;
    color: #f2cf7b;
}

.current-plan-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.current-plan-label {
    font-size: 12px;
    font-weight: 600;
    color: rgba(196, 181, 160, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.current-plan-name {
    font-size: 18px;
    font-weight: 700;
    color: #f5f0eb;
    font-family: 'Outfit', sans-serif;
}

.current-plan-price {
    text-align: right;
}

.current-plan-price span:first-child {
    font-size: 22px;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.current-plan-price span:last-child {
    font-size: 13px;
    color: rgba(196, 181, 160, 0.6);
    font-weight: 500;
}

/* Mobile responsive for status section */
@media (max-width: 768px) {
    .current-status-section {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .current-plan-mini {
        padding: 14px 18px;
    }

    .current-plan-icon {
        width: 38px;
        height: 38px;
    }

    .current-plan-icon svg {
        width: 20px;
        height: 20px;
    }

    .current-plan-name {
        font-size: 16px;
    }

    .current-plan-price span:first-child {
        font-size: 18px;
    }
}

/* ========================================
   BILLING PERIOD TOGGLE
   ======================================== */

.billing-toggle-container {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
    padding: 0.5rem 0;
}

.billing-toggle {
    display: grid;
    grid-template-columns: 1fr 1fr;
    position: relative;
    background: rgba(15, 12, 10, 0.9);
    border: 1px solid rgba(242, 207, 123, 0.15);
    border-radius: 14px;
    padding: 4px;
    width: 320px;
    box-shadow:
        inset 0 1px 3px rgba(0, 0, 0, 0.4),
        0 4px 16px rgba(0, 0, 0, 0.25);
}

.toggle-option {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 20px;
    background: transparent;
    border: none;
    border-radius: 10px;
    color: rgba(196, 181, 160, 0.5);
    font-family: 'Quicksand', sans-serif;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.3s ease;
    white-space: nowrap;
}

.toggle-option:hover:not(.active) {
    color: rgba(242, 207, 123, 0.7);
}

.toggle-option.active {
    color: #0f0d0a;
    font-weight: 700;
}

.toggle-badge {
    display: inline-flex;
    padding: 3px 8px;
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    border-radius: 6px;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    box-shadow: 0 2px 6px rgba(34, 197, 94, 0.35);
}

.toggle-option.active .toggle-badge {
    background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
}

.toggle-slider {
    position: absolute;
    top: 4px;
    left: 4px;
    width: calc(50% - 4px);
    height: calc(100% - 8px);
    background: linear-gradient(135deg, #f2cf7b 0%, #e0b565 50%, #c9a050 100%);
    border-radius: 10px;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow:
        0 2px 8px rgba(242, 207, 123, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.25);
    z-index: 1;
}

/* Move slider to right for yearly */
.billing-toggle[data-active="yearly"] .toggle-slider {
    transform: translateX(100%);
}

/* Mobile responsive for toggle */
@media (max-width: 480px) {
    .billing-toggle {
        width: 280px;
    }

    .toggle-option {
        padding: 12px 14px;
        font-size: 13px;
        gap: 6px;
    }

    .toggle-badge {
        font-size: 9px;
        padding: 2px 6px;
    }
}

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

/* 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;
    display: flex;
    flex-direction: column;
}

.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-icon-power {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.2) 0%, rgba(139, 92, 246, 0.15) 100%);
    border-color: rgba(168, 85, 247, 0.5);
    color: #a855f7;
}

.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-limit-info {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
    padding: 4px 8px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
    display: inline-block;
}

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

.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: 1rem 2rem;
    background: rgba(168, 107, 62, 0.3);
    border: 1.5px solid rgba(212, 165, 116, 0.5);
    border-radius: 10px;
    color: #f2cf7b;
    font-size: 1.05rem;
    font-weight: 600;
    font-family: 'Quicksand', sans-serif;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
    margin-top: auto;
}

.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, #f2cf7b 0%, #d29658 70%, #7d3f26 100%) !important;
    border: none !important;
    color: #0a0a0a !important;
}

.plan-button-pro:hover {
    background: linear-gradient(135deg, #f5d88a 0%, #d9a362 70%, #8a4a2d 100%) !important;
    border: none !important;
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(242, 207, 123, 0.4),
        0 0 20px rgba(242, 207, 123, 0.3);
}

.plan-button-pro:active {
    transform: translateY(0);
}

.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;
}

/* ========================================
   FOUNDERS SPECIAL - PREMIUM STYLING
   ======================================== */

/* Founders Plan Card */
.plan-card.plan-founders {
    border: 2px solid rgba(242, 207, 123, 0.5);
    background: linear-gradient(135deg,
            rgba(25, 20, 15, 0.98) 0%,
            rgba(30, 25, 18, 0.95) 50%,
            rgba(20, 18, 15, 0.98) 100%);
    box-shadow:
        0 0 30px rgba(242, 207, 123, 0.1),
        0 20px 50px rgba(0, 0, 0, 0.4);
    position: relative;
    padding-top: 3rem;
}

.plan-card.plan-founders:hover {
    border-color: rgba(242, 207, 123, 0.7);
    box-shadow:
        0 0 40px rgba(242, 207, 123, 0.2),
        0 25px 60px rgba(0, 0, 0, 0.5);
    transform: translateY(-6px);
}

.plan-card.plan-founders .plan-glow {
    display: none;
}

/* Founders Ribbon - positioned inside card */
.founders-ribbon {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 5;
}

.founders-ribbon span {
    display: inline-block;
    padding: 6px 14px;
    background: linear-gradient(135deg, #f2cf7b 0%, #d29658 50%, #b8743d 100%);
    color: #0a0a0a;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
    border-radius: 16px;
    box-shadow: 0 2px 10px rgba(242, 207, 123, 0.4);
}

/* Discount Badge - inside card bounds */
.discount-badge-container {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 5;
}

.discount-badge {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 50%, #b91c1c 100%);
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 15px rgba(239, 68, 68, 0.5);
    animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

.discount-percent {
    font-size: 18px;
    font-weight: 900;
    color: #fff;
    line-height: 1;
}

.discount-off {
    font-size: 9px;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.95);
    letter-spacing: 0.5px;
    margin-top: 1px;
}

/* Savings Badge Variant - for annual plans */
.discount-badge-savings {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 50%, #15803d 100%);
    box-shadow: 0 3px 15px rgba(34, 197, 94, 0.5);
}

.discount-badge-savings .discount-percent {
    font-size: 10px;
    letter-spacing: 0.5px;
}

.discount-badge-savings .discount-off {
    font-size: 16px;
    font-weight: 900;
    margin-top: 0;
}

/* Monthly Equivalent Text - for annual plans */
.monthly-equivalent {
    display: inline-block;
    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: 700;
    margin-top: 4px;
}

/* Hide the badge inside card for founders - we show discount badge instead */
.plan-card.plan-founders .plan-badge-founders {
    display: none;
}

/* Price Container */
.plan-price-container {
    margin-bottom: 8px;
}

/* Strikethrough Original Price */
.original-price {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}

.was-label {
    font-size: 12px;
    color: rgba(196, 181, 160, 0.5);
    font-weight: 500;
}

.price-strikethrough {
    font-size: 18px;
    font-weight: 700;
    color: rgba(196, 181, 160, 0.4);
    text-decoration: line-through;
    text-decoration-color: #ef4444;
    text-decoration-thickness: 2px;
}

/* Founders Price - subtle glow */
.founders-price {
    filter: drop-shadow(0 0 6px rgba(242, 207, 123, 0.3));
}

/* Urgency Message */
.founders-urgency {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    margin-top: 10px;
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 8px;
    color: #fca5a5;
    font-size: 11px;
    font-weight: 600;
}

.founders-urgency svg {
    color: #f87171;
    flex-shrink: 0;
    width: 14px;
    height: 14px;
}

/* Mobile Adjustments for Founders Elements */
@media (max-width: 768px) {
    .plan-card.plan-founders {
        padding-top: 2.5rem;
    }

    .founders-ribbon span {
        font-size: 9px;
        padding: 5px 12px;
    }

    .discount-badge {
        width: 48px;
        height: 48px;
    }

    .discount-percent {
        font-size: 15px;
    }

    .discount-off {
        font-size: 8px;
    }

    .founders-urgency {
        font-size: 10px;
        padding: 6px 10px;
    }
}



/* 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);
    }
}

/* ========================================
   USAGE BAR & SUBSCRIPTION DISPLAY
   ======================================== */

.usage-overview {
    padding: 1.5rem 0;
}

.usage-stats {
    text-align: center;
    margin-bottom: 1.5rem;
}

.usage-main-stat {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 4px;
}

.usage-count {
    font-size: 3.5rem;
    font-weight: 800;
    font-family: 'Quicksand', sans-serif;
    background: linear-gradient(135deg, #f2cf7b 0%, #d29658 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
}

.usage-separator {
    font-size: 2rem;
    color: var(--text-secondary);
    opacity: 0.5;
    margin: 0 4px;
}

.usage-limit {
    font-size: 2rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.usage-label {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-top: 0.5rem;
}

.usage-bar-container {
    margin-top: 1rem;
}

.usage-bar {
    height: 12px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    overflow: hidden;
    position: relative;
}

.usage-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #22c55e 0%, #16a34a 100%);
    border-radius: 6px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1), background 0.3s ease;
    position: relative;
}

/* Usage bar colors based on percentage */
.usage-bar-fill.usage-warning {
    background: linear-gradient(90deg, #f59e0b 0%, #d97706 100%);
}

.usage-bar-fill.usage-critical {
    background: linear-gradient(90deg, #ef4444 0%, #dc2626 100%);
}

.usage-bar-fill.usage-full {
    background: linear-gradient(90deg, #ef4444 0%, #b91c1c 100%);
}

.usage-bar-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 0.75rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* ============================================
   MINIMAL USAGE CARD
   ============================================ */
.usage-card-minimal {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    padding: 20px 24px;
}

.usage-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.usage-card-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.usage-card-count {
    font-family: 'Outfit', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.usage-card-count .usage-of {
    font-weight: 400;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.usage-card-bar {
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 3px;
    overflow: hidden;
}

.usage-card-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #D4A574 0%, #B8956A 100%);
    border-radius: 3px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.usage-card-bar-fill.usage-warning {
    background: linear-gradient(90deg, #f59e0b 0%, #d97706 100%);
}

.usage-card-bar-fill.usage-critical {
    background: linear-gradient(90deg, #ef4444 0%, #dc2626 100%);
}

.usage-card-bar-fill.usage-full {
    background: linear-gradient(90deg, #ef4444 0%, #b91c1c 100%);
}

.usage-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
}

.usage-card-remaining {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.usage-card-reset {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Limit Reached State */
.usage-card-limit {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.usage-card-limit p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0;
}

.usage-card-upgrade-btn {
    background: linear-gradient(135deg, #f2cf7b 0%, #d29658 70%, #7d3f26 100%);
    border: none;
    border-radius: 8px;
    padding: 10px 20px;
    font-family: 'Quicksand', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    color: #0a0a0a;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.usage-card-upgrade-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(242, 207, 123, 0.3);
}

/* Upsell State */
.usage-card-upsell {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.usage-card-upsell p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0;
}

@media (max-width: 540px) {
    .usage-card-minimal {
        padding: 16px 18px;
    }

    .usage-card-limit,
    .usage-card-upsell {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .usage-card-limit p,
    .usage-card-upsell p {
        text-align: center;
    }

    .usage-card-upgrade-btn {
        width: 100%;
        text-align: center;
    }
}

/* Upsell Card */
.upsell-card {
    margin-top: 1.5rem;
    padding: 1.25rem;
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.1) 0%, rgba(139, 92, 246, 0.05) 100%);
    border: 1px solid rgba(168, 85, 247, 0.25);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.upsell-content {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
    min-width: 200px;
}

.upsell-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.2) 0%, rgba(139, 92, 246, 0.1) 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.upsell-icon svg {
    stroke: #a855f7;
}

.upsell-text h4 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.upsell-text p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0;
}

.btn-upsell {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: linear-gradient(135deg, #a855f7 0%, #8b5cf6 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-family: 'Quicksand', sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.btn-upsell:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(168, 85, 247, 0.4);
}

/* Limit Reached Card */
.limit-reached-card {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.12) 0%, rgba(220, 38, 38, 0.06) 100%);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 16px;
}

.limit-reached-content {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
}

.limit-reached-icon {
    width: 52px;
    height: 52px;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.2) 0%, rgba(220, 38, 38, 0.1) 100%);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.limit-reached-icon svg {
    stroke: #ef4444;
}

.limit-reached-text h4 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #fca5a5;
    margin-bottom: 0.5rem;
}

.limit-reached-text p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.5;
}

.limit-reached-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.btn-upgrade-now {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    background: linear-gradient(135deg, #f2cf7b 0%, #d29658 100%);
    color: #1a1612;
    border: none;
    border-radius: 12px;
    font-family: 'Quicksand', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    flex: 1;
    min-width: 150px;
}

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

/* Plan Tag */
.plan-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.25);
    border-radius: 8px;
    color: #4ade80;
    font-size: 0.8rem;
    font-weight: 600;
    margin-top: 0.5rem;
}

.plan-tag.trial-tag {
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.25);
    color: #fbbf24;
}

/* ========================================
   RESPONSIVE - MOBILE DESIGN
   ======================================== */

/* Tablet Breakpoint */
@media (max-width: 1024px) {
    .billing-layout {
        padding: 2rem 1.5rem;
        gap: 2rem;
    }

    .billing-sidebar {
        width: 240px;
        padding: 1.5rem 1rem;
    }

    .plans-grid {
        gap: 20px;
    }
}

/* Mobile Breakpoint */
@media (max-width: 768px) {
    .billing-layout {
        flex-direction: column;
        padding: 1rem;
        gap: 1rem;
    }

    /* Hide sidebar on mobile - use bottom tabs or simplified nav */
    .billing-sidebar {
        width: 100%;
        position: relative;
        top: auto;
        padding: 1rem;
        border-radius: 16px;
        border-right: none;
        margin-bottom: 0.5rem;
    }

    .billing-sidebar .sidebar-header {
        display: none;
    }

    .billing-sidebar .sidebar-nav {
        flex-direction: row;
        gap: 8px;
    }

    .billing-sidebar .sidebar-nav-item {
        flex: 1;
        justify-content: center;
        padding: 12px 16px;
        font-size: 14px;
        gap: 8px;
    }

    .billing-sidebar .sidebar-nav-item svg {
        width: 18px;
        height: 18px;
    }

    .billing-sidebar .sidebar-nav-item span {
        display: block;
    }

    /* Content Area */
    .billing-content {
        padding: 0;
    }

    .billing-tab.active {
        overflow-x: hidden;
    }

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

    .tab-title {
        font-size: 1.5rem;
    }

    .tab-subtitle {
        font-size: 0.9rem;
    }

    /* Current Status Section */
    .current-status-section {
        grid-template-columns: 1fr;
        gap: 12px;
        margin-bottom: 20px;
    }

    .current-plan-mini {
        padding: 14px 16px;
        border-radius: 14px;
    }

    .current-plan-info {
        gap: 10px;
    }

    .current-plan-icon {
        width: 36px;
        height: 36px;
        border-radius: 10px;
    }

    .current-plan-icon svg {
        width: 18px;
        height: 18px;
    }

    .current-plan-label {
        font-size: 10px;
    }

    .current-plan-name {
        font-size: 15px;
    }

    .current-plan-price span:first-child {
        font-size: 18px;
    }

    .current-plan-price span:last-child {
        font-size: 11px;
    }

    /* Usage Card */
    .usage-card-minimal {
        padding: 16px;
        border-radius: 14px;
    }

    .usage-card-title {
        font-size: 13px;
    }

    .usage-card-count {
        font-size: 16px;
    }

    .usage-card-footer {
        font-size: 12px;
    }

    .usage-card-upgrade-btn {
        padding: 10px 16px;
        font-size: 13px;
    }

    /* Plans Grid */
    .plans-grid {
        grid-template-columns: 1fr;
        gap: 16px;
        padding-top: 8px;
    }

    /* Plan Cards */
    .plan-card {
        padding: 1.5rem;
        border-radius: 20px;
    }

    .plan-card.plan-founders {
        padding-top: 2.5rem;
    }

    .plan-icon {
        width: 44px;
        height: 44px;
    }

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

    .plan-name {
        font-size: 1.25rem;
    }

    .price-amount {
        font-size: 32px;
    }

    .price-period {
        font-size: 14px;
    }

    .plan-limit-info {
        font-size: 12px;
    }

    /* Plan Features */
    .plan-features {
        gap: 10px;
        margin: 1.5rem 0;
    }

    .feature-item {
        gap: 10px;
        font-size: 13px;
    }

    .feature-item svg {
        width: 16px;
        height: 16px;
        flex-shrink: 0;
    }

    /* Plan Button */
    .plan-button {
        padding: 14px 20px;
        font-size: 15px;
        border-radius: 12px;
    }

    /* Founders Elements */
    .founders-ribbon {
        top: 10px;
        left: 10px;
    }

    .founders-ribbon span {
        padding: 5px 10px;
        font-size: 9px;
        border-radius: 12px;
    }

    .discount-badge-container {
        top: 6px;
        right: 6px;
    }

    .discount-badge {
        width: 48px;
        height: 48px;
    }

    .discount-percent {
        font-size: 15px;
    }

    .discount-off {
        font-size: 8px;
    }

    .founders-urgency {
        padding: 8px 10px;
        font-size: 11px;
        gap: 6px;
    }

    .founders-urgency svg {
        width: 14px;
        height: 14px;
    }

    .original-price {
        gap: 4px;
    }

    .was-label {
        font-size: 10px;
    }

    .price-strikethrough {
        font-size: 16px;
    }

    .upgrade-price {
        font-size: 12px;
        padding: 5px 10px;
    }

    /* History Tab */
    .history-card {
        padding: 1rem;
    }

    /* Generic usage/upsell adjustments */
    .usage-count {
        font-size: 2.5rem;
    }

    .usage-limit {
        font-size: 1.5rem;
    }

    .upsell-card {
        flex-direction: column;
        align-items: stretch;
    }

    .upsell-content {
        flex-direction: column;
        text-align: center;
    }

    .btn-upsell {
        justify-content: center;
    }

    .limit-reached-content {
        flex-direction: column;
        text-align: center;
        align-items: center;
    }

    .limit-reached-actions {
        justify-content: center;
    }
}

/* Extra Small Mobile */
@media (max-width: 380px) {
    .billing-layout {
        padding: 0.75rem;
    }

    .billing-sidebar .sidebar-nav-item {
        padding: 10px 12px;
        font-size: 12px;
        gap: 4px;
    }

    .billing-sidebar .sidebar-nav-item svg {
        width: 16px;
        height: 16px;
    }

    .tab-title {
        font-size: 1.25rem;
    }

    .current-plan-mini {
        padding: 12px 14px;
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }

    .current-plan-price {
        text-align: left;
    }

    .plan-card {
        padding: 1.25rem;
    }

    .plan-name {
        font-size: 1.1rem;
    }

    .price-amount {
        font-size: 28px;
    }

    .feature-item {
        font-size: 12px;
    }

    .plan-button {
        padding: 12px 16px;
        font-size: 14px;
    }

    .founders-ribbon span {
        font-size: 8px;
        padding: 4px 8px;
    }

    .discount-badge {
        width: 42px;
        height: 42px;
    }

    .discount-percent {
        font-size: 13px;
    }
}