/**
 * IndianMarriage Monetization Styles
 * Styles for payment gateway, billing, and subscription pages
 * @version 1.0.0
 */

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

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

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

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

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

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

/* ============================================================================
   Animation Classes
   ============================================================================ */

.animate-fade-in {
    animation: fadeIn 0.6s ease-out forwards;
}

.animate-slide-in {
    animation: slideIn 0.5s ease-out forwards;
}

.animate-bounce-in {
    animation: bounceIn 0.8s ease-out forwards;
}

.animate-secure-flash {
    animation: secureFlash 2s ease-in-out infinite;
}

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

/* ============================================================================
   Modal Styles
   ============================================================================ */

.modal-container {
    max-height: 90vh;
    overflow: hidden;
}

.modal-body {
    overflow-y: auto;
    max-height: calc(90vh - 8rem);
}

/* Custom scrollbar for modals */
.modal-body::-webkit-scrollbar {
    width: 8px;
}

.modal-body::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

/* Dark mode scrollbar */
.dark .modal-body::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.dark .modal-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
}

.dark .modal-body::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* ============================================================================
   Payment Form Styles
   ============================================================================ */

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

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

.form-input:focus {
    transform: translateY(-0.125rem);
    box-shadow: 0 0.625rem 1.25rem -0.25rem rgba(59, 130, 246, 0.25);
}

.form-input:invalid:not(:focus):not(:placeholder-shown) {
    border-color: #ef4444;
}

.form-input:valid:not(:focus):not(:placeholder-shown) {
    border-color: #10b981;
}

/* ============================================================================
   Payment Method Styles
   ============================================================================ */

.payment-method {
    transition: all 0.3s ease;
    cursor: pointer;
}

.payment-method:hover {
    transform: translateY(-0.125rem);
    box-shadow: 0 0.625rem 1.25rem -0.25rem rgba(59, 130, 246, 0.25);
}

.payment-method.selected {
    border-color: #3b82f6;
    background-color: rgba(59, 130, 246, 0.05);
}

.dark .payment-method.selected {
    background-color: rgba(59, 130, 246, 0.1);
}

.payment-method:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Bank option styles */
.bank-option {
    transition: all 0.2s ease;
    cursor: pointer;
}

.bank-option:hover {
    transform: scale(1.02);
}

.bank-option:focus-visible {
    outline: 2px solid #10b981;
    outline-offset: 2px;
}

/* ============================================================================
   Gradients
   ============================================================================ */

.secure-gradient {
    background: linear-gradient(135deg, #059669 0%, #047857 25%, #065f46 50%, #047857 75%, #059669 100%);
}

.premium-gradient {
    background: linear-gradient(135deg, #f2764a 0%, #e35930 100%);
}

/* ============================================================================
   Card and Component Styles
   ============================================================================ */

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

.billing-card:hover {
    transform: translateY(-0.125rem);
    box-shadow: 0 0.625rem 1.25rem -0.25rem rgba(0, 0, 0, 0.1);
}

.dark .billing-card:hover {
    box-shadow: 0 0.625rem 1.25rem -0.25rem rgba(0, 0, 0, 0.3);
}

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

.feature-card:hover {
    transform: translateY(-0.25rem);
    box-shadow: 0 1.25rem 2.5rem -0.5rem rgba(242, 118, 74, 0.25);
}

/* ============================================================================
   Invoice Table Styles
   ============================================================================ */

.invoice-row {
    transition: all 0.2s ease;
}

.invoice-row:hover {
    background-color: rgba(249, 250, 251, 0.5);
}

.dark .invoice-row:hover {
    background-color: rgba(55, 65, 81, 0.3);
}

/* ============================================================================
   Status Badges
   ============================================================================ */

.status-paid {
    background: linear-gradient(135deg, #10b981, #059669);
}

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

.status-failed {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.status-active {
    background: linear-gradient(135deg, #10b981, #059669);
}

.status-paused {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.status-cancelled {
    background: linear-gradient(135deg, #6b7280, #4b5563);
}

/* ============================================================================
   Glass Effect
   ============================================================================ */

.glass-effect {
    backdrop-filter: blur(0.625rem);
    background: rgba(255, 255, 255, 0.1);
}

/* ============================================================================
   Loading Spinner
   ============================================================================ */

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.animate-spin {
    animation: spin 1s linear infinite;
}

/* ============================================================================
   Pricing Table Styles
   ============================================================================ */

.pricing-card {
    position: relative;
    transition: all 0.3s ease;
}

.pricing-card:hover {
    transform: translateY(-0.5rem);
    box-shadow: 0 1.25rem 2.5rem -0.5rem rgba(0, 0, 0, 0.15);
}

.dark .pricing-card:hover {
    box-shadow: 0 1.25rem 2.5rem -0.5rem rgba(0, 0, 0, 0.4);
}

.pricing-card.popular {
    border-width: 2px;
    border-color: #f2764a;
}

/* ============================================================================
   Payment Card Styling
   ============================================================================ */

.payment-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 1rem;
    padding: 1.5rem;
    color: white;
    min-height: 200px;
    position: relative;
    overflow: hidden;
}

.payment-card::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%);
    pointer-events: none;
}

.payment-card-chip {
    width: 50px;
    height: 40px;
    background: linear-gradient(135deg, #f0f0f0 0%, #d0d0d0 100%);
    border-radius: 0.375rem;
}

.payment-card-number {
    font-family: 'Courier New', monospace;
    font-size: 1.25rem;
    letter-spacing: 0.125rem;
}

/* ============================================================================
   Security Indicators
   ============================================================================ */

.security-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 0.5rem;
    color: #059669;
    font-size: 0.875rem;
    font-weight: 500;
}

.dark .security-badge {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
}

/* ============================================================================
   Transaction Details
   ============================================================================ */

.transaction-detail {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.dark .transaction-detail {
    border-bottom-color: rgba(255, 255, 255, 0.05);
}

.transaction-detail:last-child {
    border-bottom: none;
}

/* ============================================================================
   Payment Icons
   ============================================================================ */

.payment-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.75rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 1.5rem;
}

.payment-icon.card {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.payment-icon.upi {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
}

.payment-icon.netbanking {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

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

@media (max-width: 768px) {
    .modal-container {
        max-height: 95vh;
        margin: 0.5rem;
    }

    .modal-body {
        max-height: calc(95vh - 6rem);
    }

    .payment-method {
        padding: 1rem;
    }

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

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

@media print {
    .no-print {
        display: none !important;
    }

    .invoice-row {
        page-break-inside: avoid;
    }

    body {
        background: white;
        color: black;
    }
}

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

/* Focus visible styles for keyboard navigation */
*:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

button:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Screen reader only content */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Skip to content link for accessibility */
.skip-to-content {
    position: absolute;
    top: -40px;
    left: 0;
    background: #3b82f6;
    color: white;
    padding: 8px;
    text-decoration: none;
    z-index: 100;
}

.skip-to-content:focus {
    top: 0;
}

/* ============================================================================
   Reduced Motion Support
   ============================================================================ */

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

/* ============================================================================
   High Contrast Mode Support
   ============================================================================ */

@media (prefers-contrast: high) {
    .payment-method {
        border-width: 2px;
    }

    .payment-method.selected {
        border-width: 3px;
    }

    button {
        border-width: 2px;
    }
}

/* ============================================================================
   Dark Mode Specific Adjustments
   ============================================================================ */

.dark .secure-gradient {
    opacity: 0.9;
}

.dark .premium-gradient {
    opacity: 0.9;
}

.dark .glass-effect {
    background: rgba(0, 0, 0, 0.2);
}

/* ============================================================================
   Loading States
   ============================================================================ */

.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
}

.dark .loading::after {
    background: rgba(0, 0, 0, 0.7);
}

/* ============================================================================
   Error States
   ============================================================================ */

.error-message {
    color: #ef4444;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: flex;
    align-items: center;
}

.error-message::before {
    content: '⚠';
    margin-right: 0.25rem;
}

.dark .error-message {
    color: #f87171;
}

/* ============================================================================
   Success States
   ============================================================================ */

.success-message {
    color: #10b981;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: flex;
    align-items: center;
}

.success-message::before {
    content: '✓';
    margin-right: 0.25rem;
}

.dark .success-message {
    color: #34d399;
}

/* ============================================================================
   Utility Classes
   ============================================================================ */

.rotate-180 {
    transform: rotate(180deg);
}

.opacity-0 {
    opacity: 0;
}

.opacity-100 {
    opacity: 1;
}

.pointer-events-none {
    pointer-events: none;
}

.cursor-not-allowed {
    cursor: not-allowed;
}

.cursor-pointer {
    cursor: pointer;
}

/* ============================================================================
   Transition Utilities
   ============================================================================ */

.transition-colors {
    transition-property: color, background-color, border-color, text-decoration-color, fill, stroke;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 150ms;
}

.transition-all {
    transition-property: all;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 150ms;
}

.transition-transform {
    transition-property: transform;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 150ms;
}

/* ============================================================================
   Custom Component: Progress Bar
   ============================================================================ */

.progress-bar {
    width: 100%;
    height: 8px;
    background-color: rgba(0, 0, 0, 0.1);
    border-radius: 9999px;
    overflow: hidden;
}

.dark .progress-bar {
    background-color: rgba(255, 255, 255, 0.1);
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6 0%, #8b5cf6 100%);
    border-radius: 9999px;
    transition: width 0.3s ease;
}

/* ============================================================================
   Custom Component: Subscription Badge
   ============================================================================ */

.subscription-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.subscription-badge.premium {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
}

.subscription-badge.platinum {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    color: white;
}

.subscription-badge.family {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}
