/**
 * Billing & Plans Modal Styles
 * Slide-out modal for subscription management
 */

/* Modal Container */
.billing-modal {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
}

.billing-modal.active {
    visibility: visible;
    opacity: 1;
}

/* Modal Overlay */
.billing-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

/* Modal Content */
.billing-modal-content {
    position: absolute;
    top: 0;
    right: 0;
    width: min(700px, 95vw);
    height: 100%;
    background: var(--panel-bg);
    border-left: 1px solid var(--border-color);
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.3);
}

.billing-modal.active .billing-modal-content {
    transform: translateX(0);
}

/* Modal Header */
.billing-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
}

.billing-modal-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.billing-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.billing-modal-close:hover {
    background: var(--glass-bg);
    color: var(--text-primary);
    transform: scale(1.1);
}

/* Modal Body */
.billing-modal-body {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
}

/* Billing Sections */
.billing-section {
    margin-bottom: 32px;
}

.billing-section h3 {
    margin: 0 0 16px 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

/* Current Plan Card */
.current-plan-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 20px;
    backdrop-filter: blur(10px);
}

.plan-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.plan-header h4 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
}

.plan-price {
    font-size: 24px;
    font-weight: 700;
    color: var(--accent-color);
}

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

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

.plan-features li {
    padding: 4px 0;
    color: var(--text-secondary);
    position: relative;
    padding-left: 20px;
}

.plan-features li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--success-color);
    font-weight: bold;
}

.plan-usage {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.usage-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 14px;
}

.usage-item:last-child {
    margin-bottom: 0;
}

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

.plan-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 24px;
    backdrop-filter: blur(10px);
    position: relative;
    transition: all 0.2s ease;
}

.plan-card:hover {
    border-color: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 180, 216, 0.15);
}

.plan-card.featured {
    border-color: var(--accent-color);
    background: linear-gradient(135deg, rgba(0, 180, 216, 0.1), var(--glass-bg));
}

.plan-card.current {
    border-color: var(--success-color);
    background: linear-gradient(135deg, rgba(74, 222, 128, 0.1), var(--glass-bg));
}

.plan-badge {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent-color);
    color: white;
    padding: 4px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.plan-button {
    width: 100%;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 20px;
    background: var(--primary-gradient);
    color: white;
}

.plan-button:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 180, 216, 0.3);
}

.plan-button:disabled {
    background: var(--glass-bg);
    color: var(--text-secondary);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.plan-button.current {
    background: var(--success-color);
}

/* Billing History */
.billing-history {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 20px;
    backdrop-filter: blur(10px);
}

.history-item {
    display: grid;
    grid-template-columns: 120px 1fr auto;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
    align-items: center;
}

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

.history-date {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
}

.history-description {
    font-size: 14px;
    color: var(--text-primary);
}

.history-amount {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

/* Payment Method */
.payment-method {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 20px;
    backdrop-filter: blur(10px);
}

.no-payment-method {
    text-align: center;
    color: var(--text-secondary);
}

.no-payment-method p {
    margin: 0 0 16px 0;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 180, 216, 0.3);
}

.btn-secondary {
    background: var(--glass-bg);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--border-color);
    transform: translateY(-1px);
}

/* Responsive Design */
@media (max-width: 768px) {
    .billing-modal-content {
        width: 100vw;
        border-left: none;
    }
    
    .billing-modal-header {
        padding: 16px 20px;
    }
    
    .billing-modal-body {
        padding: 20px;
    }
    
    .plans-grid {
        grid-template-columns: 1fr;
    }
    
    .plan-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .history-item {
        grid-template-columns: 1fr;
        gap: 8px;
        text-align: left;
    }
}

/* Loading States */
.billing-modal-body.loading {
    pointer-events: none;
    opacity: 0.7;
}

.billing-modal-body.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 32px;
    height: 32px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Scrollbar styling for modal content */
.billing-modal-body::-webkit-scrollbar {
    width: 6px;
}

.billing-modal-body::-webkit-scrollbar-track {
    background: var(--darker-bg);
}

.billing-modal-body::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.billing-modal-body::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}