/* Custom Styles for Sigurd Fencing */

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Modal Scrolling Fix */
#preorderModal {
    -webkit-overflow-scrolling: touch;
}

#preorderModal .modal-content {
    max-height: calc(100vh - 2rem);
    display: flex;
    flex-direction: column;
}

/* Sticky header and scrollable content */
#preorderModal .sticky {
    flex-shrink: 0;
}

#preorderModal .overflow-y-auto {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

/* Mobile optimizations */
@media (max-width: 640px) {
    #preorderModal .modal-content {
        max-height: 100vh;
        height: 100vh;
        border-radius: 0;
        margin: 0;
    }
    
    #preorderModal .overflow-y-auto {
        padding-bottom: 2rem;
    }
}

/* Small height screens */
@media (max-height: 700px) {
    #preorderModal .sticky {
        padding-top: 1rem;
        padding-bottom: 0.5rem;
    }
    
    #preorderModal .overflow-y-auto {
        max-height: calc(100vh - 180px);
    }
}

/* Custom scrollbar for modal */
#preorderModal .overflow-y-auto::-webkit-scrollbar {
    width: 6px;
}

#preorderModal .overflow-y-auto::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

#preorderModal .overflow-y-auto::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

#preorderModal .overflow-y-auto::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Custom animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes backgroundShift {
    0% {
        background-position: 50% 50%;
    }
    25% {
        background-position: 55% 45%;
    }
    50% {
        background-position: 50% 40%;
    }
    75% {
        background-position: 45% 45%;
    }
    100% {
        background-position: 50% 50%;
    }
}

@keyframes textGlow {
    0%, 100% {
        text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.8);
    }
    50% {
        text-shadow: 2px 2px 12px rgba(0, 0, 0, 0.9), 0 0 20px rgba(220, 38, 38, 0.3);
    }
}

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

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

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

.animate-fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

.animate-slide-in-left {
    animation: slideInLeft 0.6s ease-out;
}

.animate-slide-in-right {
    animation: slideInRight 0.6s ease-out;
}

.animate-hero-float {
    animation: heroFloat 3s ease-in-out infinite;
}

.animate-background-shift {
    animation: backgroundShift 20s ease-in-out infinite;
}

.animate-text-glow {
    animation: textGlow 4s ease-in-out infinite;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Navigation enhancements */
nav {
    transition: all 0.3s ease;
}

nav.scrolled {
    background-color: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Button hover effects */
.btn-primary {
    background: linear-gradient(135deg, #dc2626, #991b1b);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

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

/* Card hover effects */
.card {
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Text gradients */
.text-gradient {
    background: linear-gradient(135deg, #dc2626, #f59e0b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Loading states */
.loading {
    position: relative;
    overflow: hidden;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    transform: translateX(-100%);
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent);
    animation: loading 1.5s infinite;
}

@keyframes loading {
    100% {
        transform: translateX(100%);
    }
}

/* Form enhancements */
.form-input {
    transition: all 0.3s ease;
    border: 2px solid #e2e8f0;
}

.form-input:focus {
    outline: none;
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.form-input:invalid {
    border-color: #ef4444;
}

.form-input:valid {
    border-color: #10b981;
}

/* Modal animations */
.modal {
    animation: modalFadeIn 0.3s ease;
}

.modal-content {
    animation: modalSlideIn 0.3s ease;
}

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

@keyframes modalSlideIn {
    from {
        transform: scale(0.9) translateY(-50px);
        opacity: 0;
    }
    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

/* Success/Error messages */
.alert {
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    border: 1px solid;
    animation: fadeInUp 0.3s ease;
}

.alert-success {
    background-color: #f0fdf4;
    border-color: #bbf7d0;
    color: #166534;
}

.alert-error {
    background-color: #fef2f2;
    border-color: #fecaca;
    color: #991b1b;
}

.alert-info {
    background-color: #eff6ff;
    border-color: #bfdbfe;
    color: #1d4ed8;
}

/* Responsive video containers */
.video-container {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    overflow: hidden;
    border-radius: 1rem;
}

.video-container video,
.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* Video element styling */
#demoVideo {
    border-radius: 1rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    background: #000;
}

#demoVideo::-webkit-media-controls-panel {
    background-color: rgba(0, 0, 0, 0.8);
}

/* Video loading states */
.video-loading {
    background: linear-gradient(45deg, #1f2937, #374151);
    background-size: 400% 400%;
    animation: videoLoadingGradient 2s ease infinite;
}

@keyframes videoLoadingGradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Progress indicators */
.progress-bar {
    width: 100%;
    height: 8px;
    background-color: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #dc2626, #f59e0b);
    border-radius: 4px;
    transition: width 0.3s ease;
}

/* Floating action button */
.fab {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #dc2626, #991b1b);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.4);
    transition: all 0.3s ease;
    z-index: 40;
    cursor: pointer;
}

.fab:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(220, 38, 38, 0.6);
}

/* Intersection observer animations */
.fade-in-section {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s ease;
}

.fade-in-section.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Custom checkbox/radio styles */
.custom-checkbox {
    appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid #cbd5e1;
    border-radius: 4px;
    background-color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.custom-checkbox:checked {
    background-color: #dc2626;
    border-color: #dc2626;
}

.custom-checkbox:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
}

/* Tooltip styles */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltip-text {
    visibility: hidden;
    width: 200px;
    background-color: #374151;
    color: white;
    text-align: center;
    border-radius: 6px;
    padding: 8px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -100px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 14px;
}

.tooltip .tooltip-text::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #374151 transparent transparent transparent;
}

.tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* Logo optimizations */
.logo-image {
    max-height: 36px;
    width: auto;
    object-fit: contain;
    transition: all 0.3s ease;
}

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

/* Hero background optimization */
.hero-background {
    background-attachment: fixed;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
}

/* Enhance text readability on background image */
.hero-text-shadow {
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.hero-backdrop {
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .container-mobile {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .text-responsive {
        font-size: clamp(1.5rem, 4vw, 2.5rem);
    }
    
    .hero-title {
        font-size: clamp(2rem, 8vw, 4rem);
        line-height: 1.2;
    }
    
    .logo-image {
        max-height: 32px;
    }
    
    /* Optimize background for mobile */
    .hero-background {
        background-attachment: scroll;
        background-position: center 30%;
    }
    
    /* Adjust overlay opacity for better mobile readability */
    .hero-overlay-mobile {
        background: linear-gradient(
            to bottom,
            rgba(0, 0, 0, 0.4),
            rgba(0, 0, 0, 0.7)
        );
    }
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
    }
    
    h1, h2, h3 {
        page-break-after: avoid;
    }
}

/* Accessibility enhancements */
@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 */
@media (prefers-contrast: high) {
    .card {
        border: 2px solid;
    }
    
    button {
        border: 2px solid;
    }
}

/* Dark mode support (placeholder) */
@media (prefers-color-scheme: dark) {
    /* Dark mode styles can be added here when needed */
}