/* Custom CSS for Astrabyte Website */

/* Prevent horizontal overflow */
html, body {
    overflow-x: hidden;
    max-width: 100%;
}

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

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

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

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #1e3a8a, #f59e0b);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #1e40af, #d97706);
}

/* Navigation active state */
.nav-link.active {
    color: #2563eb !important;
    font-weight: 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: #fff;
    animation: spin 1s ease-in-out infinite;
}

/* Mobile menu animations */
.mobile-menu-item {
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.mobile-menu-item:hover {
    transform: translateX(5px);
}

#mobile-menu {
    will-change: transform;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

#mobile-menu-overlay {
    will-change: opacity;
}

/* Hamburger icon animation */
#mobile-menu-icon {
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Ensure proper z-index stacking */
#mobile-menu {
    z-index: 9999;
}

#mobile-menu-overlay {
    z-index: 9998;
}

#mobile-menu-btn {
    z-index: 10000;
}

/* Ensure close button stays within menu */
#mobile-menu-close {
    position: relative;
    z-index: 1;
}

/* Clean mobile menu styling */
#mobile-menu {
    isolation: isolate;
}

/* Smooth menu slide animation */
@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutLeft {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(-100%);
        opacity: 0;
    }
}

/* Menu item stagger animation */
@keyframes fadeInUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Mobile menu animations */
.mobile-menu-slide {
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-menu-slide.open {
    transform: translateX(0);
}

.mobile-menu-item {
    transform: translateX(-20px);
    opacity: 0;
    transition: all 0.3s ease;
}

.mobile-menu-item.animate {
    transform: translateX(0);
    opacity: 1;
}

/* Mobile menu overlay */
.mobile-overlay {
    backdrop-filter: blur(4px);
    transition: all 0.3s ease;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Parallax effect */
.parallax {
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

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

.card-hover:hover {
    transform: translateY(-10px);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
}

/* Button animations */
.btn-animate {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.btn-animate::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-animate:hover::before {
    left: 100%;
}

/* Text reveal animation */
.text-reveal {
    overflow: hidden;
}

.text-reveal span {
    display: inline-block;
    transform: translateY(100%);
    animation: textReveal 0.8s ease forwards;
}

@keyframes textReveal {
    to {
        transform: translateY(0);
    }
}

/* Image zoom effect */
.image-zoom {
    overflow: hidden;
}

.image-zoom img {
    transition: transform 0.5s ease;
}

.image-zoom:hover img {
    transform: scale(1.1);
}

/* Gradient text animation */
.gradient-text-animate {
    background: linear-gradient(-45deg, #1e3a8a, #3b82f6, #f59e0b, #fbbf24);
    background-size: 400% 400%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 3s ease infinite;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Floating elements */
.float-animation {
    animation: floatUpDown 3s ease-in-out infinite;
}

@keyframes floatUpDown {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

/* Pulse effect */
.pulse-effect {
    animation: pulseGlow 2s ease-in-out infinite;
}

@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 0 20px rgba(59, 130, 246, 0.3); }
    50% { box-shadow: 0 0 40px rgba(59, 130, 246, 0.6); }
}

/* Typewriter effect */
.typewriter {
    overflow: hidden;
    border-right: 2px solid #f59e0b;
    white-space: nowrap;
    animation: typing 3.5s steps(40, end), blink-caret 0.75s step-end infinite;
}

@keyframes typing {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes blink-caret {
    from, to { border-color: transparent; }
    50% { border-color: #f59e0b; }
}

/* Stagger animation for lists */
.stagger-animation > * {
    opacity: 0;
    transform: translateY(20px);
    animation: staggerFadeIn 0.6s ease forwards;
}

.stagger-animation > *:nth-child(1) { animation-delay: 0.1s; }
.stagger-animation > *:nth-child(2) { animation-delay: 0.2s; }
.stagger-animation > *:nth-child(3) { animation-delay: 0.3s; }
.stagger-animation > *:nth-child(4) { animation-delay: 0.4s; }
.stagger-animation > *:nth-child(5) { animation-delay: 0.5s; }

@keyframes staggerFadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Modal animations */
.modal-overlay {
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Form focus effects */
.form-input {
    transition: all 0.3s ease;
}

.form-input:focus {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(59, 130, 246, 0.1);
}

/* Progress bar animation */
.progress-bar {
    position: relative;
    overflow: hidden;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: linear-gradient(90deg, #1e3a8a, #f59e0b);
    animation: progressFill 2s ease forwards;
}

@keyframes progressFill {
    from { width: 0%; }
    to { width: var(--progress, 100%); }
}

/* Responsive utilities */
@media (max-width: 768px) {
    .mobile-hidden {
        display: none !important;
    }

    .mobile-full {
        width: 100% !important;
    }

    .mobile-center {
        text-align: center !important;
    }

    /* Prevent horizontal overflow */
    * {
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    .container {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
        max-width: 100% !important;
    }

    /* Mobile-specific adjustments */
    .hero-title {
        font-size: 1.875rem !important; /* 30px */
        line-height: 1.2 !important;
    }

    .hero-subtitle {
        font-size: 1rem !important; /* 16px */
    }

    /* Mobile typography */
    h1 {
        font-size: 1.875rem !important; /* 30px */
        line-height: 1.2 !important;
    }

    h2 {
        font-size: 1.5rem !important; /* 24px */
        line-height: 1.3 !important;
    }

    h3 {
        font-size: 1.25rem !important; /* 20px */
        line-height: 1.4 !important;
    }

    p {
        font-size: 0.875rem !important; /* 14px */
        line-height: 1.5 !important;
    }

    /* Mobile navigation improvements */
    .mobile-nav-overlay {
        background: rgba(0, 0, 0, 0.5);
        backdrop-filter: blur(4px);
    }

    /* Mobile form improvements */
    .form-input {
        font-size: 16px !important; /* Prevents zoom on iOS */
    }

    /* Mobile card spacing */
    .mobile-card-spacing {
        padding: 1rem !important;
        margin-bottom: 1rem !important;
    }

    /* Mobile text sizing */
    .mobile-text-sm {
        font-size: 0.875rem !important;
    }

    .mobile-text-base {
        font-size: 1rem !important;
    }
}

/* Tablet responsive adjustments */
@media (min-width: 769px) and (max-width: 1024px) {
    .tablet-grid-2 {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .tablet-text-lg {
        font-size: 1.125rem !important;
    }
}

/* Touch device improvements */
@media (hover: none) and (pointer: coarse) {
    .hover-lift:hover {
        transform: none !important;
    }

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

    /* Larger touch targets */
    button, .btn, a[role="button"] {
        min-height: 44px !important;
        min-width: 44px !important;
    }
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .gradient-bg {
        background: #000 !important;
    }
    
    .text-gradient {
        background: none !important;
        color: #000 !important;
        -webkit-text-fill-color: initial !important;
    }
}

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