/**
 * Kenfore Engineering - Custom Styles
 * Additional styles not covered by Tailwind CSS
 */

/* CSS Custom Properties */
:root {
    --color-navy-900: #2c3a8f;
    --color-navy-800: #3d4db0;
    --color-navy-700: #4e60d1;
    --color-blue-600: #34a1db;
    --color-blue-500: #4fb3e8;
    --color-blue-400: #6ac5f5;
    --color-green-500: #08a64e;
    --color-green-400: #2bb96a;
    --color-green-300: #4ecb86;
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
    overflow-x: hidden;
    max-width: 100vw;
}

/* Body */
body {
    font-family: 'Montserrat', 'D-DIN', system-ui, -apple-system, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    max-width: 100vw;
}

/* Prevent all elements from causing horizontal scroll */
* {
    max-width: 100%;
}

/* Navigation Link Hover Effect */
.nav-link {
    position: relative;
    transition: color 0.2s ease-in-out;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--color-blue-600);
    transition: width 0.3s ease-in-out;
}

.nav-link:hover::after {
    width: 100%;
}

/* Dropdown Menu Animation */
.group:hover .group-hover\:opacity-100 {
    animation: fadeInDown 0.3s ease-in-out;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile Menu Animation */
#mobileMenu {
    animation: slideDown 0.3s ease-in-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
    }
    to {
        opacity: 1;
        max-height: 1000px;
    }
}

/* Button Hover Effects */
button,
.btn {
    transition: all 0.2s ease-in-out;
}

button:hover,
.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

button:active,
.btn:active {
    transform: translateY(0);
}

/* Focus Styles for Accessibility */
a:focus,
button:focus,
input:focus,
textarea:focus,
select:focus {
    outline: 2px solid var(--color-blue-600);
    outline-offset: 2px;
}

/* Skip to Main Content Link */
.skip-to-main {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--color-navy-900);
    color: white;
    padding: 8px 16px;
    text-decoration: none;
    z-index: 100;
}

.skip-to-main:focus {
    top: 0;
}

/* Hero Section Overlay */
.hero-overlay {
    background: linear-gradient(to right, rgba(44, 58, 143, 0.8), rgba(52, 161, 219, 0.6));
}

/* Card Hover Effects */
.card-hover {
    transition: all 0.3s ease-in-out;
}

.card-hover:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

/* Image Lazy Loading */
img[loading="lazy"] {
    opacity: 0;
    transition: opacity 0.3s;
}

img[loading="lazy"].loaded {
    opacity: 1;
}

/* Responsive Typography */
@media (max-width: 640px) {
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.75rem;
    }
    
    h3 {
        font-size: 1.5rem;
    }
}

/* Print Styles */
@media print {
    header,
    footer,
    .no-print {
        display: none;
    }
    
    body {
        font-size: 12pt;
        color: black;
    }
    
    a {
        text-decoration: underline;
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: var(--color-navy-900);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-blue-600);
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Utility Classes */
.text-shadow {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.gradient-text {
    background: linear-gradient(135deg, var(--color-navy-900), var(--color-blue-600));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Ensure proper contrast for accessibility */
.bg-white,
.bg-gray-50,
.bg-gray-100 {
    color: var(--color-navy-900);
}

.bg-navy-900,
.bg-gray-800,
.bg-gray-900 {
    color: white;
}

/* Modal Animations */
#contactModal,
#redirectModal {
    animation: fadeIn 0.3s ease-in-out;
}

#contactModal > div,
#redirectModal > div {
    animation: scaleIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Modal Input Focus States */
#contactForm input:focus,
#contactForm textarea:focus {
    border-color: var(--color-blue-600);
    box-shadow: 0 0 0 3px rgba(52, 161, 219, 0.1);
}

/* Modal Input Error States */
#contactForm input.border-red-500,
#contactForm textarea.border-red-500 {
    border-color: #ef4444;
}

#contactForm input.border-red-500:focus,
#contactForm textarea.border-red-500:focus {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* WhatsApp Button Pulse Animation */
@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(8, 166, 78, 0.7);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(8, 166, 78, 0);
    }
}

.fixed.bottom-6.right-6 {
    animation: pulse 2s infinite;
}

/* Smooth Modal Transitions */
#contactModal.hidden,
#redirectModal.hidden {
    display: none !important;
}

/* Prevent body scroll when modal is open */
body.modal-open {
    overflow: hidden;
}


/* ============================================
   HERO SLIDER STYLES
   ============================================ */

.hero-slide {
    transition: opacity 1s ease-in-out;
}

.hero-slide.active {
    opacity: 1;
    z-index: 1;
}

.slide-indicator {
    cursor: pointer;
    transition: all 0.3s ease-in-out;
}

.slide-indicator:hover {
    transform: scale(1.2);
}

/* Hero slider responsive adjustments */
@media (max-width: 768px) {
    #heroSlider h1 {
        font-size: 3rem;
    }
    
    #heroSlider p {
        font-size: 1.125rem;
    }
    
    #heroSlider .flex-wrap {
        flex-direction: column;
    }
    
    #heroSlider .flex-wrap > * {
        width: 100%;
        justify-content: center;
    }
}


/* ============================================
   ENHANCED SECTIONS STYLES
   ============================================ */

/* Stats Section Animation */
.stats-counter {
    animation: countUp 2s ease-out;
}

@keyframes countUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Business Unit Cards Enhanced */
.business-unit-card {
    position: relative;
    overflow: hidden;
}

.business-unit-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s;
}

.business-unit-card:hover::before {
    left: 100%;
}

/* Project Cards Aspect Ratio */
.aspect-w-16 {
    position: relative;
    padding-bottom: 75%; /* 4:3 aspect ratio */
}

.aspect-w-16 > img {
    position: absolute;
    height: 100%;
    width: 100%;
    top: 0;
    left: 0;
    object-fit: cover;
}

/* Why Choose Us Cards */
.why-choose-card {
    transition: all 0.3s ease-in-out;
}

.why-choose-card:hover {
    transform: translateY(-8px) scale(1.02);
}

/* Decorative Elements Animation */
@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-20px);
    }
}

.float-animation {
    animation: float 6s ease-in-out infinite;
}

/* Gradient Text Effect */
.gradient-heading {
    background: linear-gradient(135deg, var(--color-navy-900), var(--color-blue-600));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Enhanced Button Hover */
.btn-enhanced {
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn-enhanced::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;
    z-index: -1;
}

.btn-enhanced:hover::before {
    left: 100%;
}

/* Project Card Overlay */
.project-overlay {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Responsive adjustments for new sections */
@media (max-width: 768px) {
    .stats-counter {
        font-size: 2.5rem;
    }
    
    .why-choose-card {
        margin-bottom: 1rem;
    }
}
