/* ===========================================
   PAYMENT PAGES CSS - payment.css
   =========================================== */

/* ===========================================
   Success Checkmark Animation
   =========================================== */

.success-checkmark {
    width: 120px;
    height: 120px;
    position: relative;
}

.check-icon {
    width: 120px;
    height: 120px;
    position: relative;
    border-radius: 50%;
    box-sizing: content-box;
    border: 4px solid #4ade80;
    box-shadow: 0 0 0 1px #4ade80, inset 0 0 0 1px rgba(74, 222, 128, 0.1);
}

.check-icon::before {
    top: 3px;
    left: -2px;
    width: 30px;
    transform-origin: 100% 50%;
    border-radius: 100px 0 0 100px;
}

.check-icon::after {
    top: 0;
    left: 30px;
    width: 60px;
    transform-origin: 0 50%;
    border-radius: 0 100px 100px 0;
    animation: rotate-circle 4.25s ease-in;
}

.icon-line {
    height: 5px;
    background-color: #4ade80;
    display: block;
    border-radius: 2px;
    position: absolute;
    z-index: 10;
}

.icon-line.line-tip {
    top: 56px;
    left: 21px;
    width: 25px;
    transform: rotate(45deg);
    animation: icon-line-tip 0.75s;
}

.icon-line.line-long {
    top: 48px;
    right: 13px;
    width: 47px;
    transform: rotate(-45deg);
    animation: icon-line-long 0.75s;
}

.icon-circle {
    top: -4px;
    left: -4px;
    z-index: 10;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    position: absolute;
    box-sizing: content-box;
    border: 4px solid rgba(74, 222, 128, 0.3);
}

.icon-fix {
    top: 12px;
    width: 8px;
    left: 34px;
    z-index: 1;
    height: 105px;
    position: absolute;
    transform: rotate(-45deg);
    background-color: #111827;
}

@keyframes icon-line-tip {
    0% {
        width: 0;
        left: 1px;
        top: 28px;
    }
    54% {
        width: 0;
        left: 1px;
        top: 28px;
    }
    70% {
        width: 50px;
        left: -8px;
        top: 42px;
    }
    84% {
        width: 17px;
        left: 21px;
        top: 56px;
    }
    100% {
        width: 25px;
        left: 21px;
        top: 56px;
    }
}

@keyframes icon-line-long {
    0% {
        width: 0;
        right: 46px;
        top: 54px;
    }
    65% {
        width: 0;
        right: 46px;
        top: 54px;
    }
    84% {
        width: 55px;
        right: 0;
        top: 35px;
    }
    100% {
        width: 47px;
        right: 13px;
        top: 48px;
    }
}

@keyframes rotate-circle {
    0% {
        transform: rotate(-45deg);
    }
    5% {
        transform: rotate(-45deg);
    }
    12% {
        transform: rotate(-405deg);
    }
    100% {
        transform: rotate(-405deg);
    }
}

/* ===========================================
   Error Icon Animation
   =========================================== */

.error-icon-container {
    animation: scaleIn 0.6s ease;
}

.error-icon-container svg {
    animation: pulse 2s infinite;
}

/* ===========================================
   Cancel Icon Animation
   =========================================== */

.cancel-icon-container {
    animation: slideIn 0.6s ease;
}

.cancel-icon-container svg {
    animation: fadeInScale 0.8s ease;
}

/* ===========================================
   Global Animations
   =========================================== */

@keyframes scaleIn {
    from {
        transform: scale(0);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

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

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

/* ===========================================
   Payment Card Styles
   =========================================== */

.payment-success-card {
    animation: slideUp 0.6s ease 0.1s both;
}

.payment-details-item {
    transition: all 0.3s ease;
}

.payment-details-item:hover {
    transform: translateX(4px);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===========================================
   Status Badge Animation
   =========================================== */

.status-badge {
    animation: fadeIn 0.5s ease 0.3s both;
    display: inline-block;
}

.status-badge.success {
    background: linear-gradient(135deg, #4ade80 0%, #22c55e 100%);
}

.status-badge.error {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.status-badge.pending {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* ===========================================
   Numbered List Styles
   =========================================== */

.numbered-list {
    counter-reset: list-counter;
}

.numbered-list li {
    counter-increment: list-counter;
    animation: fadeInUp 0.6s ease backwards;
}

.numbered-list li:nth-child(1) { animation-delay: 0.1s; }
.numbered-list li:nth-child(2) { animation-delay: 0.2s; }
.numbered-list li:nth-child(3) { animation-delay: 0.3s; }
.numbered-list li:nth-child(4) { animation-delay: 0.4s; }

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===========================================
   Icon Animation Variations
   =========================================== */

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

.icon-animated:hover {
    transform: scale(1.1) rotate(5deg);
}

.icon-animated.error:hover {
    filter: drop-shadow(0 0 8px rgba(239, 68, 68, 0.5));
}

.icon-animated.success:hover {
    filter: drop-shadow(0 0 8px rgba(74, 222, 128, 0.5));
}

/* ===========================================
   Button Animations
   =========================================== */

.payment-action-btn {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.payment-action-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.1);
    transition: left 0.3s ease;
    z-index: -1;
}

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

.payment-action-btn:active {
    transform: scale(0.98);
}

/* ===========================================
   Benefits List Animation
   =========================================== */

.benefits-list li {
    animation: slideInRight 0.6s ease backwards;
}

.benefits-list li:nth-child(1) { animation-delay: 0.1s; }
.benefits-list li:nth-child(2) { animation-delay: 0.2s; }
.benefits-list li:nth-child(3) { animation-delay: 0.3s; }
.benefits-list li:nth-child(4) { animation-delay: 0.4s; }

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

/* ===========================================
   Notice Box Animation
   =========================================== */

.notice-box {
    animation: slideDown 0.6s ease 0.2s both;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
        max-height: 0;
    }
    to {
        opacity: 1;
        transform: translateY(0);
        max-height: 500px;
    }
}

/* ===========================================
   Error Reasons Animation
   =========================================== */

.error-reason {
    animation: fadeInUp 0.6s ease backwards;
}

.error-reason:nth-child(1) { animation-delay: 0.1s; }
.error-reason:nth-child(2) { animation-delay: 0.2s; }
.error-reason:nth-child(3) { animation-delay: 0.3s; }
.error-reason:nth-child(4) { animation-delay: 0.4s; }

/* ===========================================
   Loading State
   =========================================== */

.payment-loading {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.payment-loading span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #fbbf24;
    animation: loading-dot 1.4s ease-in-out infinite;
}

.payment-loading span:nth-child(1) {
    animation-delay: 0s;
}

.payment-loading span:nth-child(2) {
    animation-delay: 0.2s;
}

.payment-loading span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes loading-dot {
    0%, 60%, 100% {
        opacity: 0.3;
        transform: translateY(0);
    }
    30% {
        opacity: 1;
        transform: translateY(-10px);
    }
}

/* ===========================================
   Responsive Adjustments
   =========================================== */

@media (max-width: 768px) {
    .success-checkmark,
    .check-icon {
        width: 100px;
        height: 100px;
    }
    
    .check-icon {
        border-width: 3px;
    }
    
    .icon-line.line-tip {
        top: 47px;
        left: 17px;
    }
    
    .icon-line.line-long {
        top: 40px;
        right: 11px;
    }
    
    .icon-circle {
        width: 100px;
        height: 100px;
    }
    
    .icon-fix {
        top: 10px;
        height: 87px;
    }
}

@media (max-width: 640px) {
    .success-checkmark,
    .check-icon {
        width: 80px;
        height: 80px;
    }
    
    .check-icon {
        border-width: 3px;
    }
    
    .icon-line.line-tip {
        top: 38px;
        left: 14px;
        width: 20px;
    }
    
    .icon-line.line-long {
        top: 32px;
        right: 9px;
        width: 38px;
    }
    
    .icon-circle {
        width: 80px;
        height: 80px;
    }
    
    .icon-fix {
        top: 8px;
        width: 6px;
        left: 27px;
        height: 70px;
    }
}

/* ===========================================
   Print Styles
   =========================================== */

@media print {
    .payment-action-btn,
    .payment-cancel-option {
        display: none !important;
    }
    
    .payment-details-card {
        page-break-inside: avoid;
        border: 1px solid #000 !important;
    }
}

/* ===========================================
   Accessibility
   =========================================== */

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

@media (prefers-contrast: high) {
    .success-checkmark {
        border-width: 5px;
    }
    
    .payment-action-btn {
        border-width: 2px;
    }
}

