/**
 * Shared CSS for MS Tech Solution Website
 * Modern Corporate Tech UI - Dark Blue Theme
 */

* {
    font-family: 'Inter', 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

html {
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

body {
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Orbitron', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-weight: 700;
}

/* Hero section h1 - prevent descender cutoff */
#hero h1 {
    line-height: 1.3 !important;
    padding-bottom: 0.5rem;
    overflow: visible;
}

#hero h1 span {
    display: inline-block;
    padding-bottom: 0.25rem;
    overflow: visible;
}

/* Ensure hero content is always on top and interactive */
#hero > div[class*="z-\[2\]"] {
    position: relative;
    z-index: 2 !important;
    pointer-events: auto;
}

#hero > div[class*="z-\[1\]"] {
    pointer-events: none;
}

/* Three.js canvas container */
#hero-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

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

::-webkit-scrollbar-track {
    background: #0A1A2F;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(to bottom, #1E88E5, #4FC3F7);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(to bottom, #1976D2, #29B6F6);
}

/* Smooth fade-in animation */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

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

/* Nav link hover effect - Blue Glow */
.nav-link {
    position: relative;
    transition: color 0.3s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(to right, #1E88E5, #4FC3F7);
    transition: width 0.3s ease;
    box-shadow: 0 0 8px rgba(30, 136, 229, 0.5);
}

.nav-link:hover::after {
    width: 100%;
}

/* Mobile menu full-screen overlay */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 26, 47, 0.98);
    backdrop-filter: blur(10px);
    z-index: 9999;
    transform: translateX(-100%);
    transition: transform 0.3s ease-in-out;
    overflow-y: auto;
    opacity: 0;
    pointer-events: none;
}

.mobile-menu-overlay.active {
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
}

/* Navbar improvements for visibility */
#navbar {
    background-color: rgba(10, 26, 47, 0.95);
    border-bottom: 1px solid rgba(30, 136, 229, 0.2);
    position: fixed !important;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
    backdrop-filter: blur(10px);
}

/* Sawtooth border pattern for fixed navbar */
#navbar.navbar-fixed {
    border-bottom: none;
}

#navbar.navbar-fixed::after {
    content: '';
    position: absolute;
    bottom: -12px;
    left: 0;
    width: 100%;
    height: 12px;
    background-image: url("data:image/svg+xml,%3Csvg width='20' height='12' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0,0 L10,12 L20,0 Z' fill='%231E88E5' fill-opacity='0.3'/%3E%3C/svg%3E");
    background-repeat: repeat-x;
    background-size: 20px 12px;
    background-position: bottom;
    z-index: 1;
}

/* Ensure nav links are visible */
.nav-link {
    color: #F5F9FF;
    padding: 8px 4px;
    display: inline-block;
}

.nav-link:focus {
    outline: 2px solid #1E88E5;
    outline-offset: 4px;
    border-radius: 4px;
}

/* Mobile hamburger button visibility */
#mobile-menu-btn {
    z-index: 10000;
    padding: 8px;
    border-radius: 4px;
    transition: background-color 0.2s;
    position: relative;
}

#mobile-menu-btn:hover {
    background-color: rgba(30, 136, 229, 0.1);
}

#mobile-menu-btn:focus {
    outline: 2px solid #1E88E5;
    outline-offset: 2px;
}

/* Responsive navbar fixes */
@media (max-width: 767px) {
    /* Ensure mobile menu is above everything */
    #mobile-menu {
        z-index: 9999 !important;
    }
    
    /* Better spacing for mobile links */
    .nav-link {
        padding: 10px 0;
        font-size: 16px;
    }
    
    /* Mobile menu links better visibility */
    .mobile-menu-overlay a {
        padding: 14px 24px !important;
        display: block !important;
        text-align: center !important;
        border-radius: 8px;
        margin: 8px 20px !important;
        transition: all 0.3s ease;
        color: #F5F9FF !important;
        font-size: 18px !important;
        font-weight: 600 !important;
        opacity: 1 !important;
        visibility: visible !important;
    }
    
    .mobile-menu-overlay.active a {
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto !important;
    }
    
    .mobile-menu-overlay a:hover,
    .mobile-menu-overlay a:focus {
        background-color: rgba(30, 136, 229, 0.15) !important;
        color: #4FC3F7 !important;
        transform: scale(1.05);
    }
    
    /* Mobile logo on left side */
    #navbar .md\\:hidden {
        justify-content: space-between !important;
    }
    
    /* Hamburger button positioning */
    #mobile-menu-btn {
        position: relative !important;
        z-index: 10000 !important;
    }
    
    /* Close button in mobile menu */
    #mobile-menu-close {
        position: absolute;
        top: 1rem;
        right: 1rem;
        z-index: 10001;
        background: rgba(10, 26, 47, 0.8);
        border: 1px solid rgba(30, 136, 229, 0.3);
    }
    
    #mobile-menu-close:hover {
        background: rgba(15, 31, 58, 0.9);
        border-color: #1E88E5;
    }
    
    /* Ensure mobile navbar container is relative */
    #navbar > div {
        position: relative;
    }
    
    /* Mobile menu content container */
    .mobile-menu-overlay > div {
        position: relative;
        z-index: 1;
    }
}

/* Desktop navbar spacing improvements */
@media (min-width: 768px) {
    .nav-link {
        font-size: 15px;
        padding: 8px 12px;
    }
    
    /* Better center logo spacing */
    #navbar .flex-shrink-0 {
        min-width: 150px;
    }
}

/* WhatsApp Floating Button Styles */
.whatsapp-float {
    animation: pulse-whatsapp 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
    transform-origin: center;
}

.whatsapp-float:hover {
    transform: scale(1.1);
    box-shadow: 0 0 30px rgba(37, 211, 102, 0.6);
}

@keyframes pulse-whatsapp {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(37, 211, 102, 0);
    }
}

/* WhatsApp tooltip animation */
.whatsapp-tooltip {
    pointer-events: none;
}

.whatsapp-float:hover .whatsapp-tooltip {
    animation: slideInRight 0.3s ease-out;
}

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

/* Mobile responsive WhatsApp button */
@media (max-width: 640px) {
    .whatsapp-float {
        width: 56px;
        height: 56px;
        bottom: 20px;
        right: 20px;
    }
    
    .whatsapp-float svg {
        width: 28px;
        height: 28px;
    }
    
    .whatsapp-tooltip {
        display: none; /* Hide tooltip on mobile */
    }
}

/* Ensure proper spacing for fixed navbar */
body {
    padding-top: 0;
}

/* Sections should account for fixed navbar */
section:first-of-type {
    margin-top: 0;
}

/* Social Media Icons */
.social-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: rgba(30, 136, 229, 0.1);
    color: #4FC3F7;
    transition: all 0.3s ease;
    border: 1px solid rgba(30, 136, 229, 0.3);
}

.social-icon:hover {
    background-color: #1E88E5;
    color: #F5F9FF;
    transform: translateY(-3px) scale(1.1);
    border-color: #4FC3F7;
    box-shadow: 0 4px 12px rgba(30, 136, 229, 0.4);
}

.social-icon svg {
    transition: transform 0.3s ease;
    color: inherit;
}

.social-icon:hover svg {
    transform: scale(1.1);
    color: #F5F9FF;
}

/* Glow effects for interactive elements */
.glow-blue {
    box-shadow: 0 0 20px rgba(30, 136, 229, 0.3);
}

.glow-blue:hover {
    box-shadow: 0 0 30px rgba(79, 195, 247, 0.5);
}

/* Gradient text animation */
@keyframes gradient-shift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

.gradient-text-animated {
    background: linear-gradient(-45deg, #1E88E5, #4FC3F7, #1E88E5, #4FC3F7);
    background-size: 400% 400%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradient-shift 3s ease infinite;
}

/* Floating Contact Buttons */
#floating-buttons {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: flex-end;
}

.floating-btn {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    min-width: 56px;
    height: 56px;
    border-radius: 28px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    cursor: pointer;
    text-decoration: none;
    overflow: visible;
    position: relative;
    isolation: isolate;
    z-index: 1;
}

.floating-btn:hover {
    box-shadow: 0 6px 20px rgba(30, 136, 229, 0.4);
    transform: scale(1.05);
    z-index: 10000 !important;
}

.floating-btn:not(:hover) {
    z-index: 1;
}

.floating-btn-text {
    opacity: 0;
    max-width: 0;
    width: 0;
    transition: opacity 0.3s ease, max-width 0.3s ease, margin-left 0.3s ease, width 0.3s ease;
    margin-left: 0;
    overflow: hidden;
    white-space: nowrap;
    pointer-events: none;
}

.floating-btn:hover .floating-btn-text {
    opacity: 1;
    max-width: 200px;
    width: auto;
    margin-left: 8px;
    display: inline-block !important;
}

/* Mobile responsive adjustments */
@media (max-width: 640px) {
    #floating-buttons {
        bottom: 20px;
        right: 20px;
        gap: 12px;
    }
    
    .floating-btn {
        min-width: 52px;
        height: 52px;
    }
    
    .floating-btn svg {
        width: 22px;
        height: 22px;
    }
}

/* FAQ Styles */
.faq-item {
    transition: all 0.3s ease;
}

.faq-item:hover {
    border-color: rgba(79, 195, 247, 0.5);
    box-shadow: 0 4px 12px rgba(30, 136, 229, 0.2);
}

.faq-question svg {
    transition: transform 0.3s ease;
}

.faq-question:hover svg {
    color: #1E88E5;
}

.faq-answer {
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
