/**
 * تصميم صفحة الدفع الحديثة
 * Modern Checkout Page Styling
 * نظام مدارس تحفيظ القرآن الكريم
 */

/* ========================================
   بطاقة المبلغ الإجمالي
   Total Amount Card
   ======================================== */
.bg-gradient {
    background: linear-gradient(135deg, var(--primary-color, #153a4e) 0%, var(--secondary-color, #1b5865) 100%) !important;
    position: relative;
    overflow: hidden;
}

.bg-gradient::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: pulse-soft 3s ease-in-out infinite;
}

@keyframes pulse-soft {

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

    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

/* ========================================
   بطاقات طرق الدفع
   Payment Method Cards
   ======================================== */
.payment-method-card {
    cursor: pointer;
    display: block;
    margin: 0;
}

.payment-radio {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.payment-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid color-mix(in srgb, var(--primary-color, #153a4e) 16%, #e0e0e0 84%) !important;
    background: #ffffff;
    position: relative;
    overflow: hidden;
}

.payment-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--primary-color, #153a4e) 10%, transparent), transparent);
    transition: left 0.5s ease;
}

.payment-card:hover::before {
    left: 100%;
}

.payment-radio:checked+.payment-card {
    border-color: var(--primary-color, #153a4e) !important;
    background: linear-gradient(135deg, color-mix(in srgb, var(--primary-color, #153a4e) 8%, #ffffff 92%) 0%, color-mix(in srgb, var(--secondary-color, #1b5865) 8%, #ffffff 92%) 100%);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary-color, #153a4e) 15%, transparent), 0 8px 16px color-mix(in srgb, var(--primary-color, #153a4e) 20%, transparent);
    transform: scale(1.02);
}

.payment-radio:checked+.payment-card::after {
    content: '✓';
    position: absolute;
    top: 10px;
    right: 10px;
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, var(--primary-color, #153a4e) 0%, var(--secondary-color, #1b5865) 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
    animation: checkmark 0.3s ease-in-out;
}

@keyframes checkmark {
    0% {
        transform: scale(0) rotate(-45deg);
    }

    50% {
        transform: scale(1.2) rotate(10deg);
    }

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

.payment-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
    border-color: var(--primary-color, #153a4e) !important;
}

/* ========================================
   حقول الدفع
   Payment Fields
   ======================================== */
#paymentFieldsContainer {
    animation: fadeInUp 0.5s ease-out;
}

.payment-fields {
    display: none;
    opacity: 0;
    transform: translateY(-20px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.payment-fields.active {
    display: block !important;
    opacity: 1;
    transform: translateY(0);
}

.payment-fields .card {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.payment-fields .card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.payment-fields .alert-info {
    border-left: 4px solid var(--primary-color, #153a4e);
    background: color-mix(in srgb, var(--primary-color, #153a4e) 5%, #ffffff 95%);
    border-color: color-mix(in srgb, var(--primary-color, #153a4e) 20%, #ffffff 80%);
}

.payment-fields .list-unstyled li {
    padding: 0.5rem 0;
}

.payment-fields .bi-check-circle {
    font-size: 1.1rem;
}

/* تأثير الظهور التدريجي للعناصر */
.payment-fields.active .list-unstyled li {
    animation: slideInRight 0.4s ease-out forwards;
    opacity: 0;
}

.payment-fields.active .list-unstyled li:nth-child(1) {
    animation-delay: 0.1s;
}

.payment-fields.active .list-unstyled li:nth-child(2) {
    animation-delay: 0.2s;
}

.payment-fields.active .list-unstyled li:nth-child(3) {
    animation-delay: 0.3s;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ========================================
   أزرار الدفع
   Payment Buttons
   ======================================== */
.btn-primary {
    background: linear-gradient(135deg, var(--primary-color, #153a4e) 0%, var(--secondary-color, #1b5865) 100%);
    border: none;
    font-weight: 600;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-primary:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px color-mix(in srgb, var(--primary-color, #153a4e) 40%, transparent);
}

.btn-primary:active {
    transform: translateY(0);
}

/* ========================================
   الرسوم المتحركة
   Animations
   ======================================== */
.animate__fadeInUp {
    animation: fadeInUp 0.6s ease-out;
}

.animate__fadeInDown {
    animation: fadeInDown 0.6s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   شارة الأمان
   Security Badge
   ======================================== */
.text-muted i.bi-shield-check {
    color: var(--primary-color, #153a4e);
    font-size: 1.1rem;
}

/* ========================================
   أيقونات طرق الدفع
   Payment Method Icons
   ======================================== */
.payment-card img {
    filter: grayscale(0.5);
    transition: filter 0.3s ease;
}

.payment-radio:checked+.payment-card img,
.payment-card:hover img {
    filter: grayscale(0);
}

/* ========================================
   العناصر المعطلة (قريباً)
   Disabled Elements (Coming Soon)
   ======================================== */
.opacity-50 {
    opacity: 0.5;
    pointer-events: none;
    position: relative;
}

.opacity-50::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(2px);
}

/* ========================================
   استجابة الشاشات الصغيرة
   Mobile Responsiveness
   ======================================== */
@media (max-width: 768px) {
    .display-2 {
        font-size: 3rem;
    }

    .payment-card {
        margin-bottom: 1rem;
    }

    .btn-lg {
        padding: 1rem 1.5rem;
        font-size: 1rem;
    }
}

@media (max-width: 576px) {
    .display-2 {
        font-size: 2.5rem;
    }

    .fs-2 {
        font-size: 1.5rem !important;
    }

    .payment-card img {
        height: 24px !important;
    }
}

/* ========================================
   تأثيرات إضافية
   Additional Effects
   ======================================== */
.hover-shadow {
    transition: box-shadow 0.3s ease;
}

.hover-shadow:hover {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15) !important;
}

.transition-all {
    transition: all 0.3s ease;
}

.cursor-pointer {
    cursor: pointer;
}

/* ========================================
   بطاقة المبلغ - تأثير الضوء
   Amount Card - Light Effect
   ======================================== */
.card-body i.bi-cash-stack {
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from {
        text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
    }

    to {
        text-shadow: 0 0 25px rgba(255, 255, 255, 0.7);
    }
}
