/* Custom CSS for TransWorld International */

/* Banner Animation */
.banner-container {
    position: relative;
    overflow: hidden;
}

.banner-video,
.banner-image {
    min-height: 500px; /* Ensure minimum height for mobile */
    display: block;
    width: 100%;
    object-fit: cover;
    object-position: center;
}

/* Video specific styles */
.banner-video {
    background: #000; /* Fallback background */
}

/* Only apply zoom animation for non-GIF images */
.banner-image:not([src$=".gif"]) {
    animation: zoomIn 20s ease-in-out infinite;
}

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

/* Ensure banner doesn't get cut off by header */
#home {
    margin-top: 0;
    padding-top: 0;
}

.banner-title {
    animation: fadeInUp 1s ease-out;
}

.banner-subtitle {
    animation: fadeInUp 1s ease-out 0.2s both;
}

.banner-description {
    animation: fadeInUp 1s ease-out 0.4s both;
}

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

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

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

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

::-webkit-scrollbar-thumb {
    background: rgb(44,59,146);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgb(35,47,117);
}

/* Button hover effects */
.btn-primary {
    background: linear-gradient(135deg, rgb(44,59,146), rgb(60,80,180));
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: linear-gradient(135deg, rgb(35,47,117), rgb(44,59,146));
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(44,59,146,0.3);
}

/* Service cards hover effect */
.service-card {
    transition: all 0.3s ease;
}

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

/* Service image cards */
.service-image-card {
    transition: all 0.3s ease;
    position: relative;
}

.service-image-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 20px 40px rgba(44,59,146,0.3);
}

.service-image-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(44,59,146,0.1), rgba(60,80,180,0.1));
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.service-image-card:hover::before {
    opacity: 1;
}

/* Loading animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

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

/* Form focus effects */
.form-input:focus {
    box-shadow: 0 0 0 3px rgba(44,59,146,0.1);
    border-color: rgb(44,59,146);
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .banner-title {
        font-size: 2.5rem;
    }
    
    .banner-subtitle {
        font-size: 1.25rem;
    }
    
    .banner-description {
        font-size: 1rem;
    }
    
    .banner-video,
    .banner-image {
        min-height: 500px;
        height: 500px;
    }
}

/* Tablet optimizations */
@media (min-width: 769px) and (max-width: 1024px) {
    .banner-video,
    .banner-image {
        min-height: 700px;
    }
}

/* Desktop optimizations */
@media (min-width: 1025px) {
    .banner-video,
    .banner-image {
        min-height: 800px;
    }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    .banner-image:not([src$=".gif"]),
    .banner-title,
    .banner-subtitle,
    .banner-description {
        animation: none;
    }
    
    /* For GIF files, we can't disable the animation but we can reduce other effects */
    .banner-image[src$=".gif"] {
        transform: none;
    }
    
    /* Pause video for users who prefer reduced motion */
    .banner-video {
        animation: none;
    }
}

/* Print styles */
@media print {
    .banner-container,
    header,
    footer {
        display: none;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .bg-primary {
        background-color: #000 !important;
    }
    
    .text-primary {
        color: #000 !important;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .bg-white {
        background-color: #1a1a1a;
    }
    
    .text-gray-900 {
        color: #ffffff;
    }
    
    .text-gray-700 {
        color: #d1d5db;
    }
    
    .text-gray-600 {
        color: #9ca3af;
    }
}

/* Animation for service icons */
.service-icon {
    transition: all 0.3s ease;
}

.service-card:hover .service-icon {
    transform: scale(1.1) rotate(5deg);
}

/* Pulse animation for CTA buttons */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(44,59,146,0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(44,59,146,0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(44,59,146,0);
    }
}

.cta-pulse {
    animation: pulse 2s infinite;
}

/* Gradient text effect */
.gradient-text {
    background: linear-gradient(135deg, rgb(44,59,146), rgb(60,80,180));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Custom focus styles for better accessibility */
a:focus,
button:focus,
input:focus,
textarea:focus,
select:focus {
    outline: 2px solid rgb(44,59,146);
    outline-offset: 2px;
}

/* Skip to content link for screen readers */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: rgb(44,59,146);
    color: white;
    padding: 8px;
    text-decoration: none;
    z-index: 1000;
}

.skip-link:focus {
    top: 6px;
}

/* Loading states */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

/* Error states */
.error-message {
    background-color: #fee;
    border: 1px solid #fcc;
    color: #c33;
    padding: 12px;
    border-radius: 4px;
    margin-top: 8px;
}

/* Success states */
.success-message {
    background-color: #efe;
    border: 1px solid #cfc;
    color: #3c3;
    padding: 12px;
    border-radius: 4px;
    margin-top: 8px;
}

/* Responsive typography */
@media (max-width: 640px) {
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.5rem; }
    h4 { font-size: 1.25rem; }
}

@media (min-width: 641px) and (max-width: 1024px) {
    h1 { font-size: 3rem; }
    h2 { font-size: 2.25rem; }
    h3 { font-size: 1.875rem; }
    h4 { font-size: 1.5rem; }
}

@media (min-width: 1025px) {
    h1 { font-size: 4rem; }
    h2 { font-size: 3rem; }
    h3 { font-size: 2.25rem; }
    h4 { font-size: 1.875rem; }
}

/* Alpine.js x-cloak - Hide elements until Alpine.js loads */
[x-cloak] {
    display: none !important;
}
