/**
 * Ticket UI — Logo-based design system
 * Color scheme based on TicketBee logo
 */
:root {
    --tu-primary: #020C3E;        /* Dark Blue - Logo Background */
    --tu-secondary: #0A1E6A;      /* Lighter Dark Blue */
    --tu-accent: #1E4DFF;         /* Bright Blue - Logo Ticket */
    --tu-accent-light: #2D5BFF;   /* Lighter Blue variant */
    --tu-accent-dark: #1640CC;    /* Darker Blue for hover */
    --tu-text: #E5E5E5;           /* Light Grey - Logo Text */
    --tu-text-bright: #FFFFFF;    /* Pure White */
    --tu-muted: #9CA3AF;          /* Muted Grey */
    --tu-success: #10B981;        /* Green */
    --tu-warning: #F59E0B;        /* Amber */
    --tu-error: #EF4444;          /* Red */
    --tu-transition: 300ms ease;
}

html {
    scroll-behavior: smooth;
}

body.ticket-ui {
    font-family: "Inter", system-ui, sans-serif;
    background: linear-gradient(135deg, var(--tu-primary) 0%, var(--tu-secondary) 100%);
    background-attachment: fixed;
    color: var(--tu-text);
}

.tu-glass {
    background: rgba(10, 30, 106, 0.45);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(30, 77, 255, 0.15);
    transition: border-color var(--tu-transition), box-shadow var(--tu-transition),
        transform var(--tu-transition);
}

.tu-glass:hover {
    border-color: rgba(30, 77, 255, 0.35);
    box-shadow: 0 0 20px rgba(30, 77, 255, 0.15);
}

.tu-glass-strong {
    background: rgba(10, 30, 106, 0.75);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(30, 77, 255, 0.2);
}

.tu-shadow-soft {
    box-shadow: 0 10px 40px -12px rgba(2, 12, 62, 0.6);
}

.tu-header {
    background: rgba(2, 12, 62, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: background-color var(--tu-transition), box-shadow var(--tu-transition);
}

.tu-header.is-scrolled {
    background-color: rgba(2, 12, 62, 0.95);
    box-shadow: 0 4px 24px rgba(30, 77, 255, 0.2);
}

/* Scrollbar */
.ticket-ui ::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
.ticket-ui ::-webkit-scrollbar-track {
    background: var(--tu-primary);
}
.ticket-ui ::-webkit-scrollbar-thumb {
    background: rgba(30, 77, 255, 0.3);
    border-radius: 9999px;
}
.ticket-ui ::-webkit-scrollbar-thumb:hover {
    background: rgba(30, 77, 255, 0.5);
}

/* Hide scrollbar but keep functionality */
.scrollbar-hide {
    -ms-overflow-style: none;
    scrollbar-width: none;
}
.scrollbar-hide::-webkit-scrollbar {
    display: none;
}

/* Skeleton */
.tu-skeleton {
    background: linear-gradient(
        90deg,
        rgba(30, 77, 255, 0.08) 0%,
        rgba(30, 77, 255, 0.15) 50%,
        rgba(30, 77, 255, 0.08) 100%
    );
    background-size: 200% 100%;
    animation: tu-shimmer 1.4s ease infinite;
    border-radius: 0.75rem;
}

@keyframes tu-shimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Pulse animation for loading states */
@keyframes tu-pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.animate-pulse {
    animation: tu-pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Bottom sheet */
.tu-sheet-overlay {
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--tu-transition);
}
.tu-sheet-overlay.is-open {
    opacity: 1;
    pointer-events: auto;
}
.tu-sheet-panel {
    transform: translateY(100%);
    transition: transform var(--tu-transition);
}
.tu-sheet-overlay.is-open .tu-sheet-panel {
    transform: translateY(0);
}

/* Focus visible for a11y */
.ticket-ui :focus-visible {
    outline: 2px solid var(--tu-accent);
    outline-offset: 2px;
}

/* Sticky mobile CTA safe area */
.tu-safe-bottom {
    padding-bottom: env(safe-area-inset-bottom, 0);
}

/* Accent glow effect */
.tu-accent-glow {
    box-shadow: 0 0 20px rgba(30, 77, 255, 0.4);
}

/* Gradient text */
.tu-gradient-text {
    background: linear-gradient(135deg, var(--tu-accent) 0%, var(--tu-accent-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Mobile optimizations */
@media (max-width: 640px) {
    /* Larger touch targets on mobile */
    .tu-touch-target {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Better spacing on mobile */
    .tu-mobile-spacing {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    /* Prevent text overflow on small screens */
    .tu-mobile-text {
        font-size: 0.875rem;
        line-height: 1.25rem;
    }
    
    /* Stack elements on mobile */
    .tu-mobile-stack > * {
        width: 100%;
    }
    
    /* Hide on mobile */
    .tu-hide-mobile {
        display: none !important;
    }
}

/* Tablet optimizations */
@media (min-width: 641px) and (max-width: 1024px) {
    /* Show on tablet */
    .tu-show-tablet {
        display: block !important;
    }
}

/* Desktop optimizations */
@media (min-width: 1025px) {
    /* Show on desktop */
    .tu-show-desktop {
        display: block !important;
    }
}

/* ═══════════════════════════════════════════════════════════════════════
   ACCESSIBILITY STYLES
   ═══════════════════════════════════════════════════════════════════════ */

/* Screen reader only - hide visually but keep for screen readers */
.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;
}

/* Remove sr-only when focused (for skip links) */
.sr-only:focus,
.sr-only:active {
    position: static;
    width: auto;
    height: auto;
    padding: inherit;
    margin: inherit;
    overflow: visible;
    clip: auto;
    white-space: normal;
}

/* Enhanced focus indicators for keyboard navigation */
body.keyboard-nav *:focus {
    outline: 3px solid var(--tu-accent);
    outline-offset: 2px;
    border-radius: 4px;
}

body.keyboard-nav button:focus,
body.keyboard-nav a:focus,
body.keyboard-nav input:focus,
body.keyboard-nav select:focus,
body.keyboard-nav textarea:focus {
    box-shadow: 0 0 0 3px rgba(30, 77, 255, 0.3);
}

/* Skip to main content link */
.skip-to-main {
    transition: all 0.2s ease;
}

.skip-to-main:focus {
    animation: skipLinkPulse 0.5s ease;
}

@keyframes skipLinkPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* Reduced motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .tu-glass,
    .tu-glass-strong {
        border-width: 2px;
        border-color: var(--tu-accent);
    }
    
    button,
    a {
        text-decoration: underline;
    }
}

/* Focus visible polyfill for better keyboard navigation */
:focus:not(:focus-visible) {
    outline: none;
}

:focus-visible {
    outline: 3px solid var(--tu-accent);
    outline-offset: 2px;
}

/* Ensure interactive elements are keyboard accessible */
[role="button"],
[onclick] {
    cursor: pointer;
}

[role="button"]:focus,
[onclick]:focus {
    outline: 3px solid var(--tu-accent);
    outline-offset: 2px;
}

/* ARIA live region styling */
[role="status"],
[role="alert"] {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* ═══════════════════════════════════════════════════════════════════════
   PERFORMANCE OPTIMIZATIONS
   ═══════════════════════════════════════════════════════════════════════ */

/* GPU acceleration for animations */
.tu-glass,
.tu-glass-strong,
.tu-shadow-soft,
button,
a {
    will-change: transform;
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* Optimize font rendering */
body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* Contain layout shifts */
img,
video {
    max-width: 100%;
    height: auto;
}

/* Lazy loading placeholder */
img[loading="lazy"] {
    background: linear-gradient(135deg, rgba(10, 30, 106, 0.3) 0%, rgba(30, 77, 255, 0.1) 100%);
}

/* Smooth scrolling container */
.smooth-scroll {
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

/* Optimize repaints */
.tu-card,
.tu-glass,
.tu-glass-strong {
    contain: layout style paint;
}
