/* ====================
   HMS Marine Services - Custom Styles
   ==================== */

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

/* Hide scrollbar but keep functionality */
body {
    overflow-x: hidden;
}

/* ==================== NAVIGATION ==================== */
.nav-link {
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: #C9A962;
    transition: width 0.3s ease;
}

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

/* Navbar scroll state */
#navbar.scrolled {
    background-color: rgba(26, 43, 74, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

/* ==================== HERO ==================== */
#hero {
    background-attachment: fixed;
}

/* Hero background image fallback */
#hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #1A2B4A 0%, #2a3f5f 50%, #1A2B4A 100%);
    z-index: 0;
}

/* ==================== ANIMATIONS ==================== */
/* Fade up animation for sections */
.fade-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

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

/* Stagger animation delays */
.stagger-1 { transition-delay: 0.1s; }
.stagger-2 { transition-delay: 0.2s; }
.stagger-3 { transition-delay: 0.3s; }
.stagger-4 { transition-delay: 0.4s; }
.stagger-5 { transition-delay: 0.5s; }

/* ==================== TEAM CARDS ==================== */
.team-card .bio-expanded {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.team-card .bio-expanded.show {
    max-height: 500px;
}

.team-card .bio-toggle i {
    transition: transform 0.3s ease;
}

.team-card .bio-toggle.expanded i {
    transform: rotate(180deg);
}

/* ==================== SERVICE CARDS ==================== */
.service-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.service-card:hover {
    transform: translateY(-5px);
}

/* ==================== CONTACT FORM ==================== */
#contact-form input:focus,
#contact-form select:focus,
#contact-form textarea:focus {
    border-color: #2563EB;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Form submission states */
#contact-form.submitting button[type="submit"] {
    opacity: 0.7;
    pointer-events: none;
}

#contact-form.success button[type="submit"] {
    background-color: #22C55E;
}

/* ==================== MOBILE MENU ==================== */
#mobile-menu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

#mobile-menu.open {
    max-height: 400px;
}

/* ==================== LINE CLAMP ==================== */
.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ==================== SCROLL INDICATOR ==================== */
@keyframes bounce {
    0%, 100% {
        transform: translateY(0) translateX(-50%);
    }
    50% {
        transform: translateY(-10px) translateX(-50%);
    }
}

.animate-bounce {
    animation: bounce 2s infinite;
}

/* ==================== CUSTOM SCROLLBAR ==================== */
::-webkit-scrollbar {
    width: 10px;
}

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

::-webkit-scrollbar-thumb {
    background: #1A2B4A;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #2563EB;
}

/* ==================== RESPONSIVE ADJUSTMENTS ==================== */
@media (max-width: 768px) {
    #hero {
        background-attachment: scroll;
    }

    .grid-cols-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ==================== LOADING STATE ==================== */
.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ==================== FOCUS STATES (Accessibility) ==================== */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid #2563EB;
    outline-offset: 2px;
}

/* ==================== SELECTION ==================== */
::selection {
    background-color: #2563EB;
    color: white;
}

/* ==================== PRINT STYLES ==================== */
@media print {
    #navbar,
    #mobile-menu-btn,
    .bio-toggle {
        display: none !important;
    }

    section {
        page-break-inside: avoid;
    }
}
