/* Override body styles for billing page */
body {
    overflow: auto !important; /* Enable scrolling on billing page */
    height: auto !important;
}

/* Billing Page Styles */
.billing-main {
    min-height: calc(100vh - 120px);
    background: #1a1a2e;
    color: #ffffff;
    padding: 2rem 0;
    margin-top: 60px; /* Remove gap completely - exact header height */
}

.billing-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 2rem;
}

.billing-header {
    margin-bottom: 2rem;
}

.billing-header h1 {
    font-size: 2rem;
    font-weight: 600;
    margin: 0;
    color: #ffffff;
}

/* Subscription Status */
.subscription-status {
    background: #2d2d44;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.subscription-status h2 {
    font-size: 1.25rem;
    margin: 0 0 0.5rem 0;
    color: #ffffff;
}

.subscription-status .status-active {
    color: #27ae60;
}

.subscription-plan {
    font-size: 0.95rem;
    color: #cccccc;
    margin: 0;
}

/* Usage Details Styles */
.usage-details {
    margin-top: 1.5rem;
}

.usage-details h3 {
    font-size: 1.1rem;
    margin: 0 0 1rem 0;
    color: #ffffff;
    font-weight: 600;
}

.usage-stats {
    margin-bottom: 1rem;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    color: #cccccc;
    font-size: 0.95rem;
}

.stat-row span:first-child {
    color: #ffffff;
    font-weight: 500;
}

.stat-row span:last-child {
    font-weight: 600;
    color: #ffffff;
}

.usage-progress {
    margin: 1rem 0;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #3d3d54;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-fill {
    height: 100%;
    transition: width 0.3s ease;
}

.usage-percentage {
    font-size: 0.85rem;
    color: #888888;
    text-align: left;
}

.usage-info-box {
    margin-top: 1rem;
    padding: 1rem;
    background: #1a1a2e;
    border-radius: 8px;
    border: 1px solid #3d3d54;
}

.info-header {
    color: #667eea;
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.info-text {
    font-size: 0.9rem;
    color: #cccccc;
}

/* Tab Navigation */
.tab-navigation {
    display: flex;
    gap: 0;
    margin-bottom: 2rem;
    border-bottom: 1px solid #3d3d54;
}

.tab-btn {
    background: transparent;
    border: none;
    padding: 1rem 1.5rem;
    color: #cccccc;
    font-size: 1rem;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
    position: relative;
}

.tab-btn:hover {
    color: #ffffff;
}

.tab-btn.active {
    color: #667eea !important;
    border-bottom-color: #667eea !important;
    font-weight: 600 !important;
    background: rgba(102, 126, 234, 0.1) !important;
}

/* Tab Content */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Billing Sections */
.billing-section {
    background: #2d2d44;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.billing-section h2 {
    font-size: 1.1rem;
    margin: 0 0 1rem 0;
    color: #ffffff;
    font-weight: 600;
}

/* Payment Methods */
.payment-method-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: #1a1a2e;
    border-radius: 6px;
    margin-bottom: 0.5rem;
}

.payment-method-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.payment-method-icon {
    width: 32px;
    height: 20px;
    background: #667eea;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: bold;
    color: white;
}

.payment-method-details {
    color: #ffffff;
    font-size: 0.95rem;
}

.payment-method-expiry {
    color: #cccccc;
    font-size: 0.85rem;
}

.payment-method-status {
    background: #3d3d54;
    color: #cccccc;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.8rem;
}

.payment-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

/* Address Info */
.address-display {
    padding: 1rem;
    background: #1a1a2e;
    border-radius: 6px;
    color: #cccccc;
    line-height: 1.4;
}

.address-note {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: #888888;
}

.address-edit {
    color: #667eea;
    cursor: pointer;
    margin-left: 0.5rem;
}

/* Upcoming Invoice */
.upcoming-invoice-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: #1a1a2e;
    border-radius: 6px;
    margin-bottom: 1rem;
}

.invoice-date {
    color: #cccccc;
    font-size: 0.9rem;
}

.invoice-description {
    color: #ffffff;
    font-size: 0.95rem;
}

.invoice-amount {
    color: #ffffff;
    font-size: 1rem;
    font-weight: 600;
}

.invoice-actions {
    display: flex;
    gap: 1.5rem;
    margin-top: 1rem;
}

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

.plan-card {
    background: #1a1a2e;
    border: 2px solid #3d3d54;
    border-radius: 8px;
    padding: 1.5rem;
    position: relative;
    transition: border-color 0.2s ease;
}

.plan-card:hover {
    border-color: #667eea;
}

.plan-card.current {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

.plan-card.current::before {
    content: 'Current plan';
    position: absolute;
    top: -1px;
    right: -1px;
    background: #667eea;
    color: white;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    border-radius: 0 6px 0 8px;
}

.plan-header {
    margin-bottom: 1rem;
}

.plan-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: #ffffff;
    display: block;
    margin-bottom: 0.25rem;
}

.plan-price {
    font-size: 1.25rem;
    font-weight: bold;
    color: #667eea;
}

.plan-price-suffix {
    font-size: 0.85rem;
    color: #cccccc;
    font-weight: normal;
}

.plan-description {
    color: #cccccc;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.plan-features {
    list-style: none;
    padding: 0;
    margin: 0 0 1.5rem 0;
}

.plan-features li {
    color: #cccccc;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    position: relative;
    padding-left: 1.5rem;
}

.plan-features li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #27ae60;
    font-weight: bold;
}

.plan-button {
    width: 100%;
    padding: 0.75rem;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.plan-button.primary {
    background: #667eea;
    color: white;
}

.plan-button.primary:hover {
    background: #5a6fd8;
}

.plan-button.secondary {
    background: transparent;
    border: 1px solid #3d3d54;
    color: #cccccc;
}

.plan-button:disabled {
    background: transparent;
    border: 1px solid #3d3d54;
    color: #888888;
    cursor: not-allowed;
}

/* Cancel Section */
.cancel-section {
    border-left: 3px solid #e74c3c;
}

.cancel-section p {
    color: #cccccc;
    margin-bottom: 1rem;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.25rem;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    border: none;
}

.btn-secondary {
    background: #667eea;
    color: white;
}

.btn-secondary:hover {
    background: #5a6fd8;
}

.btn-link {
    background: transparent;
    color: #667eea;
    border: 1px solid transparent;
}

.btn-link:hover {
    color: #5a6fd8;
    text-decoration: underline;
}

.btn-danger {
    background: #e74c3c;
    color: white;
}

.btn-danger:hover {
    background: #c0392b;
}

/* Skeleton Loading */
.skeleton {
    background: linear-gradient(90deg, #3d3d54 25%, #4a4a5e 50%, #3d3d54 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

.skeleton-text {
    height: 1rem;
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

.skeleton-text.large {
    height: 1.5rem;
}

.skeleton-text.small {
    height: 0.75rem;
}

.skeleton-text.w-1-4 { width: 25%; }
.skeleton-text.w-1-2 { width: 50%; }
.skeleton-text.w-3-4 { width: 75%; }
.skeleton-text.w-full { width: 100%; }

.skeleton-button {
    height: 2.5rem;
    border-radius: 6px;
    width: 100%;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Responsive */
@media (max-width: 768px) {
    .billing-container {
        padding: 0 1rem;
    }
    
    .plans-grid {
        grid-template-columns: 1fr;
    }
    
    .payment-actions,
    .invoice-actions {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .tab-navigation {
        flex-wrap: wrap;
    }
    
    .upcoming-invoice-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}