/* BESPOKE ENGLISH - Enhanced UI Components */

/* === ENHANCED ANIMATIONS === */
@keyframes slideInFromRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInFromLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

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

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(14, 17, 63, 0.2);
    }
    50% {
        box-shadow: 0 0 20px rgba(14, 17, 63, 0.4);
    }
}

/* === ADVANCED FORM STYLES === */
.form-group {
    position: relative;
    margin-bottom: 1.5rem;
}

.floating-label {
    position: relative;
}

.floating-label input {
    width: 100%;
    padding: 1rem 1rem 0.5rem;
    border: 2px solid var(--color-border);
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
}

.floating-label label {
    position: absolute;
    left: 1rem;
    top: 1rem;
    font-size: 1rem;
    color: var(--color-text-secondary);
    transition: all 0.3s ease;
    pointer-events: none;
}

.floating-label input:focus + label,
.floating-label input:not(:placeholder-shown) + label {
    top: 0.25rem;
    font-size: 0.75rem;
    color: var(--color-primary);
    font-weight: 500;
}

.floating-label input:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(14, 17, 63, 0.1);
    outline: none;
}

/* === ENHANCED CARD INTERACTIONS === */
.interactive-card {
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.interactive-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.6s ease;
}

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

.interactive-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

/* === GLASSMORPHISM EFFECTS === */
.glass-effect {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.glass-dark {
    background: rgba(14, 17, 63, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
}

/* === ADVANCED BUTTON STYLES === */
.btn-gradient {
    background: linear-gradient(45deg, var(--color-primary), var(--color-primary-light));
    position: relative;
    overflow: hidden;
}

.btn-gradient::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.6s ease;
}

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

.btn-magnetic {
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.btn-magnetic:hover {
    transform: translateY(-2px);
    animation: float 2s ease-in-out infinite;
}

/* === PROGRESS INDICATORS === */
.step-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin: 2rem 0;
}

.step-indicator .step {
    display: flex;
    align-items: center;
    position: relative;
}

.step-indicator .step-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: white;
    background: var(--color-border);
    transition: all 0.3s ease;
    position: relative;
    z-index: 2;
}

.step-indicator .step-circle.active {
    background: var(--color-primary);
    animation: glow 2s ease-in-out infinite;
}

.step-indicator .step-circle.completed {
    background: var(--color-success);
}

.step-indicator .step-line {
    width: 60px;
    height: 2px;
    background: var(--color-border);
    transition: all 0.3s ease;
}

.step-indicator .step-line.completed {
    background: var(--color-success);
}

/* === MICRO-INTERACTIONS === */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.hover-scale {
    transition: transform 0.3s ease;
}

.hover-scale:hover {
    transform: scale(1.05);
}

.hover-glow {
    transition: box-shadow 0.3s ease;
}

.hover-glow:hover {
    box-shadow: 0 0 20px rgba(14, 17, 63, 0.3);
}

/* === LOADING STATES === */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

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

.pulse-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--color-primary);
    animation: pulse-dot 1.4s ease-in-out infinite;
}

.pulse-dot:nth-child(1) { animation-delay: -0.32s; }
.pulse-dot:nth-child(2) { animation-delay: -0.16s; }
.pulse-dot:nth-child(3) { animation-delay: 0s; }

@keyframes pulse-dot {
    0%, 80%, 100% {
        transform: scale(0);
        opacity: 0.7;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* === NOTIFICATION ENHANCEMENTS === */
.notification-slide-in {
    animation: slideInFromRight 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.notification-slide-out {
    animation: slideInFromRight 0.3s cubic-bezier(0.55, 0.055, 0.675, 0.19) reverse;
}

/* === PAYMENT FORM ENHANCEMENTS === */
.payment-method-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

.payment-method-card {
    border: 2px solid var(--color-border);
    border-radius: 0.75rem;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.payment-method-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--color-primary);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.payment-method-card:hover::before,
.payment-method-card.selected::before {
    transform: scaleX(1);
}

.payment-method-card:hover {
    border-color: var(--color-primary);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(14, 17, 63, 0.1);
}

.payment-method-card.selected {
    border-color: var(--color-primary);
    background: rgba(14, 17, 63, 0.02);
}

/* === PROGRAM SELECTOR ENHANCEMENTS === */
.program-comparison {
    position: relative;
    margin: 2rem 0;
}

.program-feature-list {
    list-style: none;
    padding: 0;
    margin: 1rem 0;
}

.program-feature-list li {
    display: flex;
    align-items: center;
    padding: 0.5rem 0;
    font-size: 0.875rem;
    color: var(--color-text-secondary);
}

.program-feature-list li::before {
    content: '✓';
    color: var(--color-success);
    font-weight: bold;
    margin-right: 0.5rem;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(16, 185, 129, 0.1);
    border-radius: 50%;
    font-size: 0.75rem;
}

.program-badge-new {
    position: absolute;
    top: -8px;
    right: -8px;
    background: linear-gradient(45deg, #ff6b6b, #feca57);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.625rem;
    font-weight: bold;
    text-transform: uppercase;
    animation: float 2s ease-in-out infinite;
}

/* === ADVANCED RESPONSIVE DESIGN === */

/* Large Desktop (1440px+) */
@media (min-width: 1440px) {
    .program-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 2rem;
    }
    
    .payment-method-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 2rem;
    }
    
    .container-max-width {
        max-width: 1200px;
    }
}

/* Desktop (1024px - 1439px) */
@media (min-width: 1024px) and (max-width: 1439px) {
    .program-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
    
    .payment-method-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
}

/* Tablet Landscape (768px - 1023px) */
@media (min-width: 768px) and (max-width: 1023px) {
    .program-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .payment-method-grid {
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
    }
    
    .floating-label input {
        padding: 0.875rem 1rem 0.5rem;
    }
    
    .modal-content {
        margin: 1rem;
        max-height: calc(100vh - 2rem);
    }
}

/* Tablet Portrait & Large Mobile (481px - 767px) */
@media (min-width: 481px) and (max-width: 767px) {
    .program-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .payment-method-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .interactive-card:hover {
        transform: translateY(-2px);
    }
    
    .btn-magnetic:hover {
        animation: none;
        transform: translateY(-1px);
    }
    
    .floating-label {
        margin-bottom: 1.25rem;
    }
    
    .category-tabs {
        justify-content: center;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .category-tab {
        flex: 1;
        min-width: 120px;
        text-align: center;
    }
}

/* Mobile (320px - 480px) */
@media (max-width: 480px) {
    .program-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .payment-method-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .interactive-card:hover {
        transform: none;
    }
    
    .btn-magnetic:hover {
        animation: none;
        transform: none;
    }
    
    .hover-lift:hover,
    .hover-scale:hover,
    .hover-glow:hover {
        transform: none;
        box-shadow: inherit;
    }
    
    .floating-label input {
        padding: 1rem 0.75rem 0.5rem;
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    .floating-label label {
        left: 0.75rem;
        font-size: 14px;
    }
    
    .modal-content {
        margin: 0;
        border-radius: 0;
        max-height: 100vh;
        height: 100vh;
    }
    
    .modal-overlay {
        padding: 0;
    }
    
    .toast {
        left: 0.5rem;
        right: 0.5rem;
        bottom: 0.5rem;
        margin: 0;
    }
    
    .category-tabs {
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .category-tab {
        width: 100%;
        padding: 0.5rem 1rem;
    }
    
    .program-item {
        padding: 1rem;
    }
    
    .payment-method-card {
        padding: 1rem;
    }
    
    .btn {
        padding: 0.875rem 1.25rem;
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    .step-indicator {
        margin: 1rem 0;
    }
    
    .step-indicator .step-circle {
        width: 32px;
        height: 32px;
        font-size: 0.875rem;
    }
    
    .step-indicator .step-line {
        width: 40px;
    }
}

/* Extra Small Mobile (< 320px) */
@media (max-width: 319px) {
    .floating-label input {
        padding: 0.875rem 0.5rem 0.375rem;
    }
    
    .floating-label label {
        left: 0.5rem;
        font-size: 12px;
    }
    
    .btn {
        padding: 0.75rem 1rem;
        font-size: 14px;
    }
    
    .program-item,
    .payment-method-card {
        padding: 0.75rem;
    }
}

/* Landscape Mobile Optimization */
@media (max-height: 500px) and (orientation: landscape) {
    .modal-content {
        max-height: 95vh;
        overflow-y: auto;
    }
    
    .floating-label input {
        padding: 0.5rem 0.75rem 0.25rem;
    }
    
    .floating-label label {
        top: 0.5rem;
        font-size: 12px;
    }
    
    .floating-label input:focus + label,
    .floating-label input:not(:placeholder-shown) + label {
        top: 0.125rem;
        font-size: 10px;
    }
    
    .step-indicator {
        margin: 0.5rem 0;
    }
    
    .program-item {
        padding: 0.75rem;
    }
}

/* Touch Device Optimizations */
@media (pointer: coarse) {
    .btn {
        min-height: 44px; /* iOS HIG minimum touch target */
        min-width: 44px;
    }
    
    .category-tab {
        min-height: 44px;
        padding: 0.75rem 1.5rem;
    }
    
    .custom-checkbox,
    .custom-radio {
        width: 24px;
        height: 24px;
    }
    
    .program-item {
        cursor: pointer;
        -webkit-tap-highlight-color: rgba(14, 17, 63, 0.1);
    }
    
    .payment-method-card {
        cursor: pointer;
        -webkit-tap-highlight-color: rgba(14, 17, 63, 0.1);
    }
}

/* High DPI Display Optimization */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .program-badge,
    .filter-option {
        font-weight: 500; /* Better readability on high DPI */
    }
    
    .card {
        border-width: 0.5px; /* Thinner borders on high DPI */
    }
}

/* Dark Mode Responsive */
@media (prefers-color-scheme: dark) {
    @media (max-width: 480px) {
        .floating-label input {
            background: #2d2d2d;
            color: white;
        }
        
        .floating-label label {
            color: #b3b3b3;
        }
        
        .modal-content {
            background: #1a1a1a;
        }
    }
}

/* Print Responsive */
@media print {
    .program-grid,
    .payment-method-grid {
        display: block !important;
    }
    
    .program-item,
    .payment-method-card {
        break-inside: avoid;
        margin-bottom: 1rem;
        page-break-inside: avoid;
    }
    
    .modal-overlay,
    .toast,
    .no-print {
        display: none !important;
    }
}

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

.focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* === HIGH CONTRAST MODE === */
@media (prefers-contrast: high) {
    :root {
        --color-primary: #000000;
        --color-background: #ffffff;
        --color-border: #000000;
        --color-text-primary: #000000;
        --color-text-secondary: #333333;
    }
    
    .card {
        border: 2px solid var(--color-border);
    }
}

/* === DARK MODE SUPPORT === */
@media (prefers-color-scheme: dark) {
    :root {
        --color-background: #1a1a1a;
        --color-surface: #2d2d2d;
        --color-text-primary: #ffffff;
        --color-text-secondary: #b3b3b3;
        --color-border: #404040;
    }
    
    .glass-effect {
        background: rgba(45, 45, 45, 0.85);
        border: 1px solid rgba(255, 255, 255, 0.1);
    }
}

/* === PRINT STYLES === */
@media print {
    .interactive-card,
    .btn-gradient,
    .btn-magnetic {
        animation: none !important;
        transform: none !important;
        transition: none !important;
    }
    
    .glass-effect {
        background: white !important;
        backdrop-filter: none !important;
    }
    
    .hover-lift,
    .hover-scale,
    .hover-glow {
        transform: none !important;
        box-shadow: none !important;
    }
}
