/* FCRGROUP Custom Styles */
/* Additional custom styles to complement TailwindCSS */

/* Comprehensive Responsive Breakpoints */
/* Extra Small Devices (320px and up) */
@media (min-width: 320px) {
    .container {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }
    
    h1 { font-size: 1.5rem !important; line-height: 1.2; }
    h2 { font-size: 1.375rem !important; line-height: 1.3; }
    h3 { font-size: 1.25rem !important; line-height: 1.4; }
    
    .btn-primary {
        padding: 0.625rem 1.25rem !important;
        font-size: 0.8125rem !important;
    }
}

/* Small Devices (375px and up) */
@media (min-width: 375px) {
    h1 { font-size: 1.625rem !important; }
    h2 { font-size: 1.4375rem !important; }
    h3 { font-size: 1.3125rem !important; }
    
    .container {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
}

/* Medium Small Devices (414px and up) */
@media (min-width: 414px) {
    h1 { font-size: 1.75rem !important; }
    h2 { font-size: 1.5rem !important; }
    h3 { font-size: 1.375rem !important; }
}

/* Small Tablets and Large Phones (480px and up) */
@media (min-width: 480px) {
    h1 { font-size: 2rem !important; }
    h2 { font-size: 1.75rem !important; }
    h3 { font-size: 1.5rem !important; }
    
    .btn-primary {
        padding: 0.75rem 1.5rem !important;
        font-size: 0.875rem !important;
    }
    
    .grid.grid-cols-1 {
        gap: 1.25rem !important;
    }
}

/* Tablets (600px and up) */
@media (min-width: 600px) {
    h1 { font-size: 2.25rem !important; }
    h2 { font-size: 2rem !important; }
    h3 { font-size: 1.625rem !important; }
    
    .container {
        padding-left: 1.25rem !important;
        padding-right: 1.25rem !important;
    }
    
    .grid.grid-cols-1.md\:grid-cols-2 {
        gap: 1.5rem !important;
    }
}

/* Large Tablets (768px and up) */
@media (min-width: 768px) {
    h1 { font-size: 2.5rem !important; }
    h2 { font-size: 2.25rem !important; }
    h3 { font-size: 1.75rem !important; }
    
    .container {
        padding-left: 1.5rem !important;
        padding-right: 1.5rem !important;
    }
    
    .btn-primary {
        padding: 0.875rem 1.75rem !important;
        font-size: 0.9375rem !important;
    }
}

/* Small Desktops (896px and up) */
@media (min-width: 896px) {
    h1 { font-size: 2.75rem !important; }
    h2 { font-size: 2.375rem !important; }
    h3 { font-size: 1.875rem !important; }
}

/* Desktops (1024px and up) */
@media (min-width: 1024px) {
    h1 { font-size: 3rem !important; }
    h2 { font-size: 2.5rem !important; }
    h3 { font-size: 2rem !important; }
    
    .container {
        padding-left: 2rem !important;
        padding-right: 2rem !important;
    }
}

/* Large Desktops (1280px and up) */
@media (min-width: 1280px) {
    h1 { font-size: 3.25rem !important; }
    h2 { font-size: 2.75rem !important; }
    h3 { font-size: 2.125rem !important; }
}

/* Extra Large Desktops (1440px and up) */
@media (min-width: 1440px) {
    h1 { font-size: 3.5rem !important; }
    h2 { font-size: 3rem !important; }
    h3 { font-size: 2.25rem !important; }
}

/* Ultra Wide Desktops (1920px and up) */
@media (min-width: 1920px) {
    h1 { font-size: 4rem !important; }
    h2 { font-size: 3.5rem !important; }
    h3 { font-size: 2.5rem !important; }
    
    .container {
        max-width: 1920px !important;
        margin: 0 auto !important;
    }
}

/* Device-Specific Optimizations */

/* iPhone SE and similar small devices */
@media (max-width: 375px) and (max-height: 667px) {
    .heroSwiper .swiper-slide {
        min-height: 100vh !important;
    }
    
    .heroSwiper .bg-white\/10 {
        padding: 1rem !important;
        margin: 0.5rem !important;
    }
    
    .relative.w-40 {
        width: 5rem !important;
        height: 5rem !important;
    }
    
    .relative.w-40 img {
        height: 3rem !important;
    }
}

/* iPhone 12/13 and standard phones */
@media (min-width: 376px) and (max-width: 414px) {
    .relative.w-40 {
        width: 6rem !important;
        height: 6rem !important;
    }
    
    .relative.w-40 img {
        height: 3.5rem !important;
    }
}

/* iPhone 12/13 Pro Max and large phones */
@media (min-width: 415px) and (max-width: 428px) {
    .relative.w-40 {
        width: 7rem !important;
        height: 7rem !important;
    }
    
    .relative.w-40 img {
        height: 4rem !important;
    }
}

/* iPad Mini */
@media (min-width: 768px) and (max-width: 812px) {
    .heroSwiper .bg-white\/10 {
        padding: 2rem !important;
        margin: 1rem !important;
    }
    
    .grid.grid-cols-1.md\:grid-cols-2 {
        gap: 2rem !important;
    }
}

/* iPad and standard tablets */
@media (min-width: 813px) and (max-width: 1023px) {
    .heroSwiper .bg-white\/10 {
        padding: 2.5rem !important;
        margin: 1.5rem !important;
    }
    
    .btn-primary {
        padding: 1rem 2rem !important;
        font-size: 1rem !important;
    }
}

/* iPad Pro and large tablets */
@media (min-width: 1024px) and (max-width: 1365px) {
    .heroSwiper .bg-white\/10 {
        padding: 3rem !important;
        margin: 2rem !important;
    }
}

/* Landscape optimizations */
@media (max-width: 1024px) and (orientation: landscape) {
    .heroSwiper .swiper-slide {
        min-height: 120vh !important;
    }
    
    .relative.w-40 {
        transform: scale(0.8) !important;
    }
    
    .heroSwiper .bg-white\/10 {
        padding: 1rem !important;
        margin: 0.5rem !important;
    }
}

/* Ultra-wide landscape */
@media (min-width: 1366px) and (orientation: landscape) {
    .container {
        max-width: 1366px !important;
    }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    img {
        image-rendering: -webkit-optimize-contrast !important;
        image-rendering: crisp-edges !important;
    }
}

/* Dark mode support for mobile */
@media (prefers-color-scheme: dark) and (max-width: 768px) {
    .bg-white {
        background-color: #1a1a1a !important;
    }
    
    .text-gray-900 {
        color: #f5f5f5 !important;
    }
    
    .text-gray-700 {
        color: #d1d5db !important;
    }
}

/* 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;
    }
    
    .animate-spin {
        animation: none !important;
    }
    
    .animate-pulse {
        animation: none !important;
    }
}

/* Print styles for mobile */
@media print and (max-width: 768px) {
    .no-print {
        display: none !important;
    }
    
    body {
        font-size: 10pt !important;
        line-height: 1.3 !important;
    }
    
    h1 { font-size: 14pt !important; }
    h2 { font-size: 12pt !important; }
    h3 { font-size: 11pt !important; }
}

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

/* Performance optimizations */
.swiper-slide {
    will-change: transform;
    backface-visibility: hidden;
    perspective: 1000px;
}

/* Lazy loading placeholder - REMOVED */
.swiper-slide {
    background-image: inherit !important;
}

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

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

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

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

.animate-on-scroll {
    opacity: 0;
    transition: all 0.6s ease-out;
}

.animate-in {
    opacity: 1;
}

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

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

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

.animate-in.scale-in {
    animation: scaleIn 0.6s ease-out forwards;
}

/* Hero Swiper custom styles */
.heroSwiper {
    position: relative;
}

.heroSwiper .swiper-slide {
    position: relative;
    overflow: hidden;
}

.heroSwiper .swiper-slide > div:first-child {
    position: relative;
    z-index: 2;
}

.heroSwiper .swiper-slide > div:nth-child(2) {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    transition: transform 10s ease-in-out;
}

.heroSwiper .swiper-slide:hover > div:nth-child(2) {
    transform: scale(1.05);
}

.heroSwiper .swiper-button-next,
.heroSwiper .swiper-button-prev {
    color: white;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    width: 64px;
    height: 64px;
    margin-top: -32px;
    transition: all 0.3s ease;
}

.heroSwiper .swiper-button-next::after,
.heroSwiper .swiper-button-prev::after {
    font-size: 24px;
    font-weight: bold;
}

.heroSwiper .swiper-button-next:hover,
.heroSwiper .swiper-button-prev:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.1);
}

.heroSwiper .swiper-pagination-bullet {
    background: white;
    opacity: 0.5;
    width: 12px;
    height: 12px;
    margin: 0 6px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.heroSwiper .swiper-pagination-bullet-active {
    opacity: 1;
    background: linear-gradient(45deg, #fbbf24, #f59e0b);
    transform: scale(1.2);
    box-shadow: 0 0 20px rgba(251, 191, 36, 0.5);
}

/* Custom button styles */
.btn-primary {
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
    color: white;
    padding: 12px 32px;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-block;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #3b82f6 0%, #1e3a8a 100%);
    transition: left 0.3s ease;
    z-index: -1;
}

.btn-primary:hover::before {
    left: 0;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(30, 58, 138, 0.3);
}

/* Card hover effects */
.card-hover {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.card-hover::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(30, 58, 138, 0.1) 0%, rgba(59, 130, 246, 0.1) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

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

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

.card-hover > * {
    position: relative;
    z-index: 2;
}

/* Form styles */
.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: white;
}

.form-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-input.error {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #374151;
}

.form-error {
    color: #ef4444;
    font-size: 14px;
    margin-top: 4px;
}

/* Loading spinner */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Success and error messages */
.alert {
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    border-left: 4px solid;
}

.alert-success {
    background: #f0fdf4;
    border-color: #22c55e;
    color: #15803d;
}

.alert-error {
    background: #fef2f2;
    border-color: #ef4444;
    color: #dc2626;
}

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

/* Parallax effect */
.parallax {
    will-change: transform;
}

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

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

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

::-webkit-scrollbar-thumb:hover {
    background: #1e3a8a;
}

/* Mobile Menu Touch Improvements */
@media (max-width: 768px) {
    /* Touch-friendly button sizes */
    .md:hidden button {
        min-height: 44px !important;
        min-width: 44px !important;
        touch-action: manipulation !important;
    }
    
    /* Mobile menu overlay improvements */
    .fixed.inset-0.bg-black\/50 {
        cursor: pointer !important;
        touch-action: manipulation !important;
    }
    
    /* Mobile menu container */
    .bg-white.rounded-2xl {
        cursor: default !important;
        touch-action: pan-y !important;
    }
    
    /* Menu links - larger touch targets */
    .space-y-3 a {
        min-height: 44px !important;
        display: flex !important;
        align-items: center !important;
        touch-action: manipulation !important;
        -webkit-tap-highlight-color: transparent !important;
    }
    
    /* Close button improvements */
    .text-gray-500 button {
        min-height: 44px !important;
        min-width: 44px !important;
        touch-action: manipulation !important;
    }
    
    /* Prevent text selection during menu interaction */
    .md:hidden {
        -webkit-user-select: none !important;
        -moz-user-select: none !important;
        -ms-user-select: none !important;
        user-select: none !important;
    }
}

/* High contrast touch devices */
@media (hover: none) and (pointer: coarse) {
    .md:hidden button:active {
        transform: scale(0.95) !important;
        transition: transform 0.1s ease !important;
    }
    
    .space-y-3 a:active {
        transform: scale(0.98) !important;
        transition: transform 0.1s ease !important;
    }
}

/* Loading Screen Mobile Centering */
#loadingScreen {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 9999 !important;
    overflow: hidden !important;
}

#loadingScreen .relative {
    position: relative !important;
    transform: none !important;
    top: auto !important;
    left: auto !important;
    margin: 0 auto !important;
}

/* Mobile specific loading fixes */
@media (max-width: 768px) {
    #loadingScreen {
        -webkit-overflow-scrolling: touch !important;
        overflow: hidden !important;
    }
    
    #loadingScreen .relative {
        max-width: 90vw !important;
        max-height: 90vh !important;
    }
}

/* iOS Safari specific fix */
@supports (-webkit-touch-callout: none) {
    #loadingScreen {
        position: -webkit-sticky !important;
        position: sticky !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 100vh !important;
        min-height: -webkit-fill-available !important;
    }
}

/* Small mobile devices */
@media (max-width: 480px) {
    #loadingScreen .relative {
        transform: scale(0.9) !important;
        max-width: 85vw !important;
        max-height: 85vh !important;
    }
}

/* Landscape mobile */
@media (max-width: 768px) and (orientation: landscape) {
    #loadingScreen .relative {
        transform: scale(0.8) !important;
    }
}

/* Mobile menu enhancements */
@media (max-width: 768px) {
    .mobile-menu {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .mobile-menu.active {
        transform: translateX(0);
    }
    
    /* Responsive typography */
    h1 {
        font-size: 2rem !important;
        line-height: 1.2;
    }
    
    h2 {
        font-size: 1.75rem !important;
        line-height: 1.3;
    }
    
    h3 {
        font-size: 1.5rem !important;
        line-height: 1.4;
    }
    
    /* Responsive spacing */
    .container {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
    
    /* Hero section mobile fixes */
    .heroSwiper .swiper-slide {
        min-height: 100vh !important;
    }
    
    .heroSwiper .bg-white\/10 {
        padding: 2rem 1rem !important;
        margin: 1rem !important;
    }
    
    /* Button mobile fixes */
    .btn-primary {
        padding: 0.75rem 1.5rem !important;
        font-size: 0.875rem !important;
    }
    
    /* Card mobile fixes */
    .card-hover {
        margin-bottom: 1rem;
    }
    
    /* Grid mobile fixes */
    .grid {
        gap: 1rem !important;
    }
    
    /* Navigation mobile fixes */
    header img {
        height: 40px !important;
    }
    
    /* Mobile menu overlay */
    .fixed.inset-0 {
        backdrop-filter: blur(4px);
    }
    
    /* Form mobile fixes */
    .form-input {
        font-size: 16px !important; /* Prevent zoom on iOS */
    }
    
    /* Swiper mobile fixes */
    .swiper-button-next,
    .swiper-button-prev {
        width: 40px !important;
        height: 40px !important;
        margin-top: -20px !important;
    }
    
    .swiper-pagination-bullet {
        width: 8px !important;
        height: 8px !important;
        margin: 0 3px !important;
    }
}

/* Small mobile devices */
@media (max-width: 480px) {
    h1 {
        font-size: 1.5rem !important;
    }
    
    h2 {
        font-size: 1.375rem !important;
    }
    
    .heroSwiper .bg-white\/10 {
        padding: 1.5rem 0.75rem !important;
        margin: 0.75rem !important;
    }
    
    .container {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }
    
    /* Stats grid mobile */
    .grid.grid-cols-2 {
        gap: 0.5rem !important;
    }
    
    .text-center.p-6 {
        padding: 1rem !important;
    }
}

/* Landscape mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .heroSwiper .swiper-slide {
        min-height: 120vh !important;
    }
}

/* Touch devices */
@media (hover: none) and (pointer: coarse) {
    .hover\:scale-105:hover {
        transform: none !important;
    }
    
    .hover\:scale-110:hover {
        transform: none !important;
    }
    
    .hover\:shadow-2xl:hover {
        box-shadow: inherit !important;
    }
}

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

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

/* Focus styles for better accessibility */
*:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Skip to main content link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: #3b82f6;
    color: white;
    padding: 8px;
    text-decoration: none;
    border-radius: 4px;
    z-index: 1000;
}

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

/* Dark mode support (optional) */
@media (prefers-color-scheme: dark) {
    .dark-mode-auto {
        background: #1f2937;
        color: #f9fafb;
    }
    
    .dark-mode-auto .form-input {
        background: #374151;
        border-color: #4b5563;
        color: #f9fafb;
    }
    
    .dark-mode-auto .form-input:focus {
        border-color: #3b82f6;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .btn-primary {
        border: 2px solid #000;
    }
    
    .form-input {
        border-width: 2px;
    }
}

/* 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;
    }
}
