/* Billing Components CSS */

/* Billing Manager */
.billing-manager {
    max-width: 800px;
    margin: 0 auto;
    padding: 24px;
}

.billing-manager.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    gap: 16px;
}

.billing-header {
    margin-bottom: 32px;
    text-align: center;
    border-bottom: 1px solid #e9ecef;
    padding-bottom: 24px;
}

.billing-header h2 {
    color: #32325d;
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 8px;
}

.billing-description {
    color: #6c757d;
    font-size: 16px;
    margin: 0;
}

/* Billing Tabs */
.billing-tabs {
    display: flex;
    border-bottom: 2px solid #e9ecef;
    margin-bottom: 32px;
    overflow-x: auto;
}

.tab-button {
    background: none;
    border: none;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 500;
    color: #6c757d;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tab-button:hover {
    color: #635bff;
    background-color: rgba(99, 91, 255, 0.05);
}

.tab-button.active {
    color: #635bff;
    border-bottom-color: #635bff;
    background-color: rgba(99, 91, 255, 0.1);
}

.tab-button i {
    font-size: 16px;
}

/* Billing Content Sections */
.billing-content {
    min-height: 400px;
}

.payment-method-section,
.preferences-section,
.portal-section {
    background: #fff;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    padding: 24px;
}

.section-description {
    color: #6c757d;
    margin-bottom: 24px;
    font-size: 14px;
    line-height: 1.5;
}

/* Portal Section */
.portal-features {
    margin: 24px 0;
}

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

.portal-features li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    color: #495057;
}

.portal-features i.fa-check {
    color: #28a745;
    font-size: 14px;
}

.portal-button {
    margin: 24px 0 16px 0;
    padding: 12px 24px;
    font-size: 16px;
}

.portal-note {
    color: #6c757d;
    font-size: 13px;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.portal-note i {
    color: #635bff;
}

/* Billing Preferences Form */
.preferences-form {
    max-width: 600px;
}

.form-section {
    margin-bottom: 32px;
}

.form-section h4 {
    color: #32325d;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e9ecef;
}

.form-group {
    margin-bottom: 20px;
}

/* Custom Checkbox Styling */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    font-weight: 500;
    color: #32325d;
    padding: 8px 0;
    position: relative;
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid #cfd7df;
    border-radius: 4px;
    position: relative;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.checkbox-label:hover .checkmark {
    border-color: #635bff;
}

.checkbox-label input:checked + .checkmark {
    background-color: #635bff;
    border-color: #635bff;
}

.checkbox-label input:checked + .checkmark::after {
    content: '';
    position: absolute;
    left: 6px;
    top: 2px;
    width: 6px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.form-text {
    color: #6c757d;
    font-size: 12px;
    margin-top: 4px;
    margin-left: 32px;
    line-height: 1.4;
}

/* Form Actions */
.form-actions {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid #e9ecef;
}

/* Alert Styles */
.alert {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.alert-danger {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.alert-success {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.alert i {
    flex-shrink: 0;
}

/* Loading States */
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e9ecef;
    border-top: 3px solid #635bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Button Styles */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border: 1px solid transparent;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.15s ease;
    min-width: 120px;
}

.btn-primary {
    background: linear-gradient(135deg, #635bff 0%, #5a52e8 100%);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #5a52e8 0%, #524bd9 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(99, 91, 255, 0.3);
}

.btn-primary:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn i.fa-spinner {
    animation: spin 1s linear infinite;
}

/* Responsive Design */
@media (max-width: 768px) {
    .billing-manager {
        padding: 16px;
    }
    
    .billing-header {
        margin-bottom: 24px;
    }
    
    .billing-header h2 {
        font-size: 24px;
    }
    
    .billing-tabs {
        margin-bottom: 24px;
    }
    
    .tab-button {
        padding: 10px 16px;
        font-size: 13px;
    }
    
    .payment-method-section,
    .preferences-section,
    .portal-section {
        padding: 16px;
    }
    
    .form-section h4 {
        font-size: 16px;
    }
    
    .portal-button {
        width: 100%;
    }
    
    .checkbox-label {
        font-size: 14px;
    }
    
    .preferences-form {
        max-width: none;
    }
}

@media (max-width: 480px) {
    .billing-tabs {
        flex-direction: column;
    }
    
    .tab-button {
        border-bottom: 1px solid #e9ecef;
        border-radius: 0;
        justify-content: flex-start;
    }
    
    .tab-button.active {
        border-left: 3px solid #635bff;
        border-bottom-color: #e9ecef;
    }
    
    .portal-features li {
        font-size: 14px;
    }
    
    .form-text {
        margin-left: 0;
        margin-top: 8px;
    }
}