/* RR GROWTH (M) SDN BHD - Custom Styles */

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

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

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

::-webkit-scrollbar-thumb {
    background: #0F6CBD;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #0A2A4A;
}

/* Focus states for accessibility */
a:focus,
button:focus,
input:focus,
textarea:focus {
    outline: 2px solid #0F6CBD;
    outline-offset: 2px;
}

/* Navigation active states */
.nav-link.active {
    color: #0F6CBD !important;
}

/* Header backdrop blur effect */
#header {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* Hero section animated gradient */
#home {
    background: linear-gradient(135deg, 
        rgba(10, 42, 74, 0.05) 0%, 
        rgba(15, 108, 189, 0.05) 100%);
}

/* Subtle animations for cards */
.service-card,
.feature-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Form styling */
input:focus,
textarea:focus {
    border-color: #0F6CBD;
    box-shadow: 0 0 0 3px rgba(15, 108, 189, 0.1);
}

/* Custom button animations */
.btn-primary {
    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%;
}

/* Loading animation for form submission */
.loading {
    position: relative;
    color: transparent;
}

.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    margin: auto;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Toast animation */
.toast-show {
    transform: translateX(0) !important;
    opacity: 1 !important;
}

/* Back to top button */
#back-to-top {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#back-to-top.show {
    opacity: 1;
    visibility: visible;
}

/* Responsive improvements */
@media (max-width: 768px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    /* Mobile navigation */
    #mobile-menu {
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(10px);
        border-radius: 12px;
        margin-top: 12px;
        padding: 16px;
        box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
    }
    
    /* Adjust hero text for mobile */
    .hero-title {
        font-size: 2.5rem;
        line-height: 1.2;
    }
    
    /* Stack service cards vertically on mobile */
    .service-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .text-gray-600 {
        color: #374151 !important;
    }
    
    .text-gray-500 {
        color: #4B5563 !important;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    html {
        scroll-behavior: auto;
    }
}

/* Print styles */
@media print {
    .fixed,
    #mobile-menu,
    #back-to-top,
    #toast {
        display: none !important;
    }
    
    .bg-gradient-to-r,
    .bg-gradient-to-br {
        background: white !important;
        color: black !important;
    }
    
    a[href^="mailto:"]:after {
        content: " (" attr(href) ")";
    }
    
    .shadow-lg,
    .shadow-sm {
        box-shadow: none !important;
    }
}

/* Performance optimizations */
.lazy-load {
    opacity: 0;
    transition: opacity 0.3s;
}

.lazy-load.loaded {
    opacity: 1;
}

/* Utility classes */
.text-shadow {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

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

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

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

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

/* Logo animation */
.logo-hover:hover {
    animation: pulse 2s infinite;
}

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

/* Service icon animations */
.service-icon {
    transition: all 0.3s ease;
}

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

/* Custom focus ring */
.focus-ring:focus {
    outline: none;
    ring-width: 2px;
    ring-color: #0F6CBD;
    ring-opacity: 0.5;
}

/* Improved color contrast for WCAG AA compliance */
.text-gray-400 {
    color: #6B7280;
}

.text-gray-500 {
    color: #4B5563;
}

.text-gray-600 {
    color: #374151;
}

/* Enhanced hover states */
.hover-lift:hover {
    transform: translateY(-2px);
    transition: transform 0.2s ease-out;
}

/* Custom border radius */
.rounded-2xl {
    border-radius: 1rem;
}

.rounded-xl {
    border-radius: 0.75rem;
}

/* Box shadow utilities */
.shadow-soft {
    box-shadow: 0 2px 15px -3px rgba(0, 0, 0, 0.07), 
                0 10px 20px -2px rgba(0, 0, 0, 0.04);
}

.shadow-float {
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 
                0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Custom scrollbar for webkit browsers */
.custom-scroll::-webkit-scrollbar {
    width: 4px;
}

.custom-scroll::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 2px;
}

.custom-scroll::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 2px;
}

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