/* Topup Details Page Styles */

/* Loading and Animation Effects */
.loading-overlay {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(4px);
}

.pulse-animation {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.fade-in {
    animation: fadeIn 0.5s ease-in;
}

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

/* Service Grid Layout */
.service-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

/* Desktop view - 3 columns */
@media (min-width: 768px) {
    .service-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1rem;
    }
}

/* Service Card Styling */
.service-card {
    overflow: visible; /* Allow badges to show outside card bounds */
    position: relative;
    min-height: 140px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.service-card-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    padding: 12px 8px;
}

/* Service Image Styling */
.service-image {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    object-fit: cover;
    margin: 0 auto 8px;
    border: 2px solid #e5e7eb;
    transition: all 0.3s ease;
}

.service-image.loading {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* Radio Button States */
input[type="radio"]:checked + div {
    border-color: #3b82f6 !important;
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.2), 0 0 0 1px rgba(59, 130, 246, 0.1);
    transform: translateY(-2px) scale(1.02);
    border-radius: 1em;
}

input[type="radio"]:checked + div .absolute {
    opacity: 1 !important;
}

input[type="radio"]:checked + div .service-image {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

/* Pulse animation for selected card */
input[type="radio"]:checked + div::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 14px;
    border: 2px solid #3b82f6;
    animation: pulse-border 2s infinite;
    pointer-events: none;
}

@keyframes pulse-border {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Hover Effects */
.service-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-color: #3b82f6 !important;
}

@media (min-width: 768px) {
    .service-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    }
}

/* Selection Animation */
.selected-pulse {
    animation: selectedPulse 0.6s ease-out;
}

@keyframes selectedPulse {
    0% { transform: translateY(-2px) scale(1.02); }
    50% { transform: translateY(-4px) scale(1.05); }
    100% { transform: translateY(-2px) scale(1.02); }
}

/* Badge Positioning */
.service-card .absolute.-top-2.-right-2 {
    top: -0.5rem;
    right: -0.5rem;
}

/* Typography and Utilities */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-through {
    text-decoration: line-through;
    text-decoration-thickness: 2px;
}

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

/* Enhanced Gradient Badges */
.gradient-badge {
    background: linear-gradient(45deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

/* Sidebar Enhancements */
#purchase-summary {
    transition: all 0.3s ease;
}

#selected-package {
    transition: color 0.3s ease;
}

#total-price {
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

#total-price.updated {
    animation: priceUpdate 0.5s ease-out;
}

@keyframes priceUpdate {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Help Card Animations */
.space-y-3 > * + * {
    margin-top: 0.75rem;
}

.space-y-3 a:hover {
    transform: translateX(4px);
    transition: transform 0.2s ease;
}

/* Mobile Responsive Adjustments */
@media (max-width: 640px) {
    .service-grid {
        gap: 0.5rem;
    }
    
    .service-card {
        min-height: 140px;
        padding: 0;
    }
    
    .service-card-content {
        padding: 8px 6px;
    }
    
    .service-image {
        width: 40px;
        height: 40px;
    }
    
    .service-name {
        font-size: 0.875rem;
        line-height: 1.25rem;
    }
    
    .service-price {
        font-size: 0.875rem;
        line-height: 1.25rem;
    }
    
    /* Smaller badges on mobile */
    .service-card .absolute.-top-2.-right-2 span,
    .service-card .absolute.-top-2 span {
        font-size: 0.6rem;
        padding: 0.25rem 0.5rem;
    }
    
    /* Adjust container padding on mobile */
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    /* Stack layout on mobile for better readability */
    .lg\\:grid-cols-4 {
        grid-template-columns: 1fr;
    }
    
    /* Mobile form improvements */
    .form-input-mobile {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    /* Better touch targets for mobile */
    .mobile-touch-target {
        min-height: 44px;
        min-width: 44px;
    }
}