/**
 * 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;
    overflow-x: hidden;
    max-width: 100%;
}

body {
    overflow-x: hidden;
    max-width: 100%;
    width: 100%;
}

#main-content {
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
}

img,
video,
canvas,
svg {
    max-width: 100%;
}

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

/* Hero headline — two lines, gradient on second line */
#hero h1.hero-headline {
    line-height: 1.3;
    padding-bottom: 0.5rem;
    overflow: visible;
}

#hero .hero-headline-accent {
    display: block;
    padding-bottom: 0.15rem;
    overflow: visible;
}

/* Typing paragraph — reserved height, no layout jump */
#hero .hero-typing {
    min-height: 4.5rem;
}

@media (min-width: 640px) {
    #hero .hero-typing {
        min-height: 3.25rem;
    }
}

@media (min-width: 768px) {
    #hero .hero-typing {
        min-height: 3.75rem;
    }
}

#hero .hero-typing-text {
    display: inline;
}

#hero .gsap-hero {
    position: relative;
    z-index: 2;
    pointer-events: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

#hero .hero-animate {
    opacity: 1;
    transform: none;
    will-change: transform, opacity;
}

/* 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 — content stays visible; only slides up */
.fade-in {
    opacity: 1;
    transform: translateY(24px);
    transition: transform 0.8s ease-out, opacity 0.8s ease-out;
}

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

@media (prefers-reduced-motion: reduce) {
    .fade-in,
    .fade-in.visible {
        transform: none;
        transition: none;
    }
}

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

/* Navbar fixed state (removed sawtooth design) */
#navbar.navbar-fixed {
    border-bottom: 1px solid rgba(30, 136, 229, 0.2);
}

/* 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;
    }
    
    /* Force full-screen mobile menu behavior */
    .mobile-menu-overlay {
        transform: translateX(-100%);
        opacity: 0;
        pointer-events: none;
        visibility: hidden;
    }
    
    .mobile-menu-overlay.active {
        transform: translateX(0);
        opacity: 1;
        pointer-events: auto;
        visibility: visible;
    }
    
    /* 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);
    }
}

/* Premium animation/effects utilities (non-destructive) */
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-12px); }
}

@keyframes blobMove {
    0% { transform: translate3d(0, 0, 0) scale(1); }
    40% { transform: translate3d(28px, -16px, 0) scale(1.07); }
    75% { transform: translate3d(-18px, 24px, 0) scale(0.95); }
    100% { transform: translate3d(0, 0, 0) scale(1); }
}

@keyframes blink {
    0%, 49% { opacity: 1; }
    50%, 100% { opacity: 0; }
}

@keyframes marqueeScroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

@keyframes callPulse {
    0% { transform: scale(0.75); opacity: 0.55; }
    100% { transform: scale(1.8); opacity: 0; }
}

@keyframes loaderFill {
    0% { width: 0; }
    100% { width: 100%; }
}

@keyframes spin-slow {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes spin-reverse {
    from { transform: rotate(360deg); }
    to { transform: rotate(0deg); }
}

.float-el {
    animation: float 6s ease-in-out infinite;
}

.blob {
    position: absolute;
    width: 260px;
    height: 260px;
    border-radius: 999px;
    filter: blur(36px);
    opacity: 0.2;
    z-index: 0;
    pointer-events: none;
    animation: blobMove 14s ease-in-out infinite;
}

.blob-a {
    top: 10%;
    left: -80px;
    background: radial-gradient(circle at 30% 30%, rgba(79, 195, 247, 0.45), rgba(79, 195, 247, 0));
}

.blob-b {
    right: -80px;
    bottom: 10%;
    background: radial-gradient(circle at 30% 30%, rgba(30, 136, 229, 0.4), rgba(30, 136, 229, 0));
}

.typing-cursor {
    display: inline-block;
    width: 8px;
    height: 1.05em;
    margin-left: 6px;
    border-radius: 2px;
    background: #4FC3F7;
    vertical-align: middle;
    animation: blink 1s steps(2, end) infinite;
}

.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0;
    height: 3px;
    z-index: 100001;
    background: linear-gradient(to right, #1E88E5, #4FC3F7);
    box-shadow: 0 0 12px rgba(79, 195, 247, 0.5);
}

.cursor-dot,
.cursor-glow {
    position: fixed;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 100002;
    transform: translate3d(-999px, -999px, 0);
}

.cursor-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #4FC3F7;
}

.cursor-glow {
    width: 42px;
    height: 42px;
    border-radius: 999px;
    background: radial-gradient(circle at center, rgba(79, 195, 247, 0.24), rgba(79, 195, 247, 0));
}

.btn-lift:hover {
    transform: translateY(-2px) !important;
}

.tilt-card {
    transition: transform 220ms ease, box-shadow 300ms ease;
    transform-style: preserve-3d;
    will-change: transform;
}

.orbit-ring {
    position: absolute;
    inset: -12px;
    border: 1px solid rgba(79, 195, 247, 0.3);
    border-radius: 999px;
    pointer-events: none;
}

.spin-slow { animation: spin-slow 7s linear infinite; }
.spin-reverse { animation: spin-reverse 10s linear infinite; inset: -20px; }

.loader-progress-track {
    position: absolute;
    bottom: 18%;
    left: 50%;
    transform: translateX(-50%);
    width: min(480px, 75vw);
    height: 4px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    overflow: hidden;
}

.loader-progress-fill {
    height: 100%;
    width: 0;
    background: linear-gradient(to right, #1E88E5, #4FC3F7);
    animation: loaderFill 1.8s ease forwards;
}

.toast-host {
    position: fixed;
    top: 90px;
    right: 16px;
    z-index: 100004;
}

.toast {
    min-width: 260px;
    max-width: 360px;
    padding: 12px 14px;
    color: #F5F9FF;
    border: 1px solid rgba(79, 195, 247, 0.3);
    background: rgba(10, 26, 47, 0.92);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
    transform: translateY(-12px) scale(0.97);
    opacity: 0;
    transition: transform 400ms cubic-bezier(.17,.84,.44,1.32), opacity 260ms ease;
}

.toast.show {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.gallery-modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(6px);
    z-index: 100003;
}

.gallery-modal.hidden {
    display: none;
}

.gallery-modal img {
    max-width: min(92vw, 1100px);
    max-height: 82vh;
    border-radius: 12px;
    border: 1px solid rgba(79, 195, 247, 0.25);
    background: rgba(10, 26, 47, 0.8);
}

.gallery-close,
.gallery-nav {
    position: absolute;
    border: none;
    background: rgba(10, 26, 47, 0.75);
    color: #F5F9FF;
    padding: 10px 12px;
    border-radius: 10px;
    cursor: pointer;
}

.gallery-close { top: 20px; right: 20px; }
.gallery-prev { left: 20px; top: 50%; transform: translateY(-50%); }
.gallery-next { right: 20px; top: 50%; transform: translateY(-50%); }

.home-services-swiper .swiper-slide {
    height: auto;
}

.tshirt-swiper .swiper-pagination-bullet,
.printing-swiper .swiper-pagination-bullet {
    background: #4FC3F7;
    opacity: 0.5;
}

.tshirt-swiper .swiper-pagination-bullet-active,
.printing-swiper .swiper-pagination-bullet-active {
    opacity: 1;
}

@media (hover: none) {
    .cursor-dot, .cursor-glow {
        display: none;
    }
}

/* Global mobile responsive fixes */
section {
    overflow-x: clip;
}

.swiper,
.home-services-swiper,
.printing-swiper {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

.swiper-slide {
    box-sizing: border-box;
}

h1, h2, h3, h4 {
    overflow-wrap: break-word;
    word-wrap: break-word;
}

@media (max-width: 767px) {
    #hero {
        overflow: hidden;
        min-height: 100svh;
    }

    #hero .gsap-hero {
        min-height: auto;
        padding-top: 1rem;
        padding-bottom: 2rem;
    }

    #hero .hero-headline {
        font-size: clamp(1.625rem, 7vw, 2.25rem);
        line-height: 1.25;
        padding-bottom: 0.25rem;
    }

    #hero .hero-typing {
        font-size: clamp(0.95rem, 3.8vw, 1.125rem);
        min-height: auto;
        line-height: 1.6;
        padding-inline: 0.25rem;
    }

    #hero .hero-animate > span.inline-block {
        max-width: 100%;
        white-space: normal;
        text-align: center;
        line-height: 1.45;
        font-size: 0.75rem;
    }

    #hero .hero-animate.flex a {
        width: 100%;
        max-width: 20rem;
        justify-content: center;
        text-align: center;
    }

    #hero .orbit-ring {
        display: none;
    }

    .blob {
        width: 180px;
        height: 180px;
        opacity: 0.14;
    }

    .blob-a {
        left: -60px;
    }

    .blob-b {
        right: -60px;
    }

    #stats .relative.inline-block {
        width: 100%;
        max-width: 18rem;
    }

    #stats [class*="min-w-"] {
        min-width: 0;
        width: 100%;
    }

    .font-heading.text-4xl,
    .font-heading.text-3xl,
    h1.font-heading,
    h2.font-heading {
        font-size: clamp(1.375rem, 5.8vw, 2.125rem);
        line-height: 1.25;
    }

    h1.font-heading.text-4xl,
    h1.font-heading.text-5xl,
    h1.font-heading.text-6xl {
        font-size: clamp(1.75rem, 7vw, 2.5rem);
    }

    section .max-w-7xl,
    section .max-w-4xl,
    section .max-w-6xl {
        width: 100%;
    }

    .printing-card,
    .service-card,
    .project-card,
    .faq-item {
        max-width: 100%;
    }

    .printing-card h3,
    .service-card h3 {
        font-size: clamp(1.125rem, 4.5vw, 1.5rem);
        line-height: 1.3;
    }

    .tilt-card:hover,
    .btn-lift:hover,
    a[class*="hover:scale-105"]:hover {
        transform: none !important;
    }

    .gallery-close {
        top: 12px;
        right: 12px;
    }

    .gallery-prev {
        left: 8px;
    }

    .gallery-next {
        right: 8px;
    }

    .toast-host {
        left: 12px;
        right: 12px;
        top: 76px;
    }

    .toast {
        min-width: 0;
        max-width: 100%;
        width: 100%;
    }

    footer .grid {
        gap: 2rem;
    }
}

@media (max-width: 380px) {
    #about-preview .grid.grid-cols-2 {
        grid-template-columns: 1fr;
    }

    #hero .hero-headline {
        font-size: 1.5rem;
    }
}

/* Google AdSense slots — hidden until an ad actually loads */
.ms-ad-slot {
    display: none;
    width: 100%;
    max-width: 728px;
    margin: 2rem auto;
    padding: 0;
    overflow: hidden;
    text-align: center;
    min-height: 0;
}

.ms-ad-slot.ad-slot--visible {
    display: block;
}

.ms-ad-slot ins.adsbygoogle {
    display: block;
    margin: 0 auto;
    min-height: 0;
}

.ms-ad-slot--wide {
    max-width: 970px;
}

.ms-ad-slot--infeed {
    max-width: 100%;
}

@media (max-width: 767px) {
    .ms-ad-slot {
        margin: 1.25rem auto;
        max-width: 100%;
    }
}
