/**
 * Add License Modal Styles
 *
 * Modern, professional styling for the Add License modal
 * Compatible with Bootstrap 5 and existing dashboard theme
 *
 * @version 1.0.0
 */

/* ========================================
   Modal Base Styles
======================================== */
.payefb-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.payefb-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s ease-in-out;
}

.payefb-modal-content {
    position: relative;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease-out;
}

/* ========================================
   Modal Header
======================================== */
.payefb-modal-header {
    padding: 24px 28px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px 12px 0 0;
}

.payefb-modal-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
}

.payefb-modal-title i {
    font-size: 1.75rem;
}

.payefb-modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #fff;
    font-size: 1.25rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.payefb-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

/* ========================================
   Modal Body
======================================== */
.payefb-modal-body {
    padding: 28px;
}

/* ========================================
   Form Sections
======================================== */
.form-section {
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.form-section h5 {
    color: #2c3e50;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
}

.step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.875rem;
    margin-right: 12px;
}

/* ========================================
   Subscription Cards
======================================== */
.subscriptions-list {
    max-height: 300px;
    overflow-y: auto;
    padding-right: 8px;
}

.subscriptions-list::-webkit-scrollbar {
    width: 6px;
}

.subscriptions-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.subscriptions-list::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 10px;
}

.subscription-option {
    margin-bottom: 0 !important;
}

.subscription-card {
    display: block;
    padding: 20px;
    background: #fff;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.subscription-card:hover {
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
    transform: translateY(-2px);
}

.subscription-card.disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: #f8f9fa;
}

.subscription-card.disabled:hover {
    border-color: #e9ecef;
    box-shadow: none;
    transform: none;
}

.subscription-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.subscription-card input[type="radio"]:checked ~ .subscription-info {
    opacity: 1;
}

.subscription-card input[type="radio"]:checked {
    accent-color: #667eea;
}

.subscription-info {
    opacity: 0.8;
    transition: opacity 0.3s ease;
    margin-left: 0;
}

.subscription-card:has(input[type="radio"]:checked) {
    border-color: #667eea;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

/* ========================================
   Form Controls
======================================== */
.form-control:focus,
.form-control-lg:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

.form-control.is-valid {
    border-color: #28a745;
    padding-right: calc(1.5em + 0.75rem);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%2328a745' d='M2.3 6.73L.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

.form-control.is-invalid {
    border-color: #dc3545;
    padding-right: calc(1.5em + 0.75rem);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc3545'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

.invalid-feedback {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: #dc3545;
}

/* ========================================
   Progress Bar
======================================== */
.progress {
    background-color: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar {
    transition: width 0.6s ease;
}

/* ========================================
   Badges
======================================== */
.badge {
    font-weight: 600;
    padding: 0.35em 0.65em;
    font-size: 0.75rem;
}

/* ========================================
   Buttons
======================================== */
.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #5568d3 0%, #6a3f8f 100%);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
    transform: translateY(-2px);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ========================================
   Alerts
======================================== */
.alert {
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
}

.alert i {
    font-size: 1.25rem;
}

.alert-info {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border-left: 4px solid #667eea;
    color: #2c3e50;
}

.alert-success {
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.1) 0%, rgba(25, 135, 84, 0.1) 100%);
    border-left: 4px solid #28a745;
    color: #155724;
}

.alert-danger {
    background: linear-gradient(135deg, rgba(220, 53, 69, 0.1) 0%, rgba(200, 35, 51, 0.1) 100%);
    border-left: 4px solid #dc3545;
    color: #721c24;
}

/* ========================================
   Animations
======================================== */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   Responsive Design
======================================== */
@media (max-width: 768px) {
    .payefb-modal-content {
        max-width: 100%;
        margin: 10px;
        max-height: 95vh;
    }

    .payefb-modal-header {
        padding: 20px;
    }

    .payefb-modal-title {
        font-size: 1.25rem;
    }

    .payefb-modal-body {
        padding: 20px;
    }

    .form-section {
        padding: 16px;
    }

    .subscription-card {
        padding: 16px;
    }

    .subscription-card input[type="radio"] {
        top: 16px;
        right: 16px;
    }
}

/* ========================================
   Custom Scrollbar
======================================== */
.payefb-modal-content::-webkit-scrollbar {
    width: 8px;
}

.payefb-modal-content::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.payefb-modal-content::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 4px;
}

.payefb-modal-content::-webkit-scrollbar-thumb:hover {
    background: #5568d3;
}

/* ========================================
   Utility Classes
======================================== */
.cursor-pointer {
    cursor: pointer;
}

.text-break {
    word-break: break-word;
    overflow-wrap: break-word;
}
