/* Global Styles - Common CSS for all pages */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-blue: #0A4C6F;
    --accent-blue: #1E88E5;
    --light-blue: #E3F2FD;
    --dark-navy: #002B47;
    --gray-dark: #2C3E50;
    --gray-medium: #546E7A;
    --gray-light: #ECEFF1;
    --white: #FFFFFF;
    --orange-accent: #FF6B35;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--gray-dark);
    overflow-x: hidden;
}

/* ===== LOGO STYLES - CLEAN AND SIMPLE ===== */
.logo {
    position: fixed !important;
    top: 10px !important;
    left: 20px !important;
    z-index: 1001 !important;
    display: block !important;
    width: 100px !important;
    height: auto !important;
    transition: all 0.3s ease !important;
}

.logo img {
    width: 100% !important;
    height: auto !important;
    display: block !important;
    border-radius: 5px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
    transition: all 0.3s ease !important;
    background: white !important;
    padding: 5px !important;
}

.logo:hover img {
    transform: translateY(-3px) !important;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2) !important;
}

body.scrolled .logo {
    width: 110px !important;
    top: 8px !important;
}

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

.logo {
    animation: slideInLogo 0.5s ease-out !important;
}

/* ===== MODERN HEADER & NAVIGATION STYLES ===== */

#header {
    background: #ffffff;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.08);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 999 !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#header.scrolled {
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
}

.main-nav {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: flex-end !important;
    align-items: center;
    padding: 0.75rem 2rem;
    position: relative;
    padding-left: 120px !important;
}

/* Desktop Navigation */
.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
    align-items: center;
    margin: 0;
    padding: 0;
    margin-left: auto !important;
}

.nav-links > li {
    position: relative;
}

.nav-links a {
    color: var(--gray-dark);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    position: relative;
    padding: 0.5rem 0;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.nav-links > li > a:hover {
    color: var(--accent-blue);
}

/* Underline effect for main nav items */
.nav-links > li > a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-blue);
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-links > li > a:hover::after {
    width: 100%;
}

/* Dropdown Arrow Animation */
.dropdown-arrow {
    transition: transform 0.3s ease;
    margin-left: 0.25rem;
}

.nav-dropdown:hover .dropdown-arrow {
    transform: rotate(180deg);
}

/* Mega Dropdown Menu */
.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding-top: 1.5rem;
    min-width: 900px;
    max-width: 1100px;
    z-index: 100;
}

.nav-dropdown::before {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    height: 1.5rem;
    background: transparent;
    z-index: 99;
}

.nav-dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}

.dropdown-content {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0;
    padding: 1.5rem;
}

.dropdown-section {
    padding: 1rem;
    border-right: 1px solid rgba(0, 0, 0, 0.06);
}

.dropdown-section:last-child {
    border-right: none;
}

.dropdown-section-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--accent-blue);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--accent-blue);
}

.dropdown-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.dropdown-list li {
    margin-bottom: 0.25rem;
}

.dropdown-list a {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 0.5rem;
    border-radius: 8px;
    transition: all 0.2s ease;
    text-decoration: none;
}

.dropdown-list a:hover {
    background: linear-gradient(135deg, rgba(30, 136, 229, 0.08), rgba(30, 136, 229, 0.04));
    transform: translateX(4px);
}

.dropdown-list a::after {
    display: none;
}

.service-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
    line-height: 1;
}

.service-info {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.service-name {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--gray-dark);
    line-height: 1.3;
}

.service-desc {
    font-size: 0.75rem;
    color: var(--gray-medium);
    line-height: 1.2;
}

/* Portfolio Dropdown Specific Styles */
.portfolio-dropdown .dropdown-content {
    max-width: 1100px;
    grid-template-columns: repeat(3, 1fr);
}

.portfolio-cta-section {
    grid-column: 1 / -1;
    padding-top: 1.5rem;
    margin-top: 1.5rem;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.view-all-portfolio {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, var(--accent-blue), var(--primary-blue));
    color: white;
    text-decoration: none;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1.05rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(30, 136, 229, 0.3);
}

.view-all-portfolio:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(30, 136, 229, 0.4);
    background: linear-gradient(135deg, #1976D2, #0A4C6F);
}

.view-all-portfolio .arrow {
    font-size: 1.3rem;
    transition: transform 0.3s ease;
}

.view-all-portfolio:hover .arrow {
    transform: translateX(5px);
}

.portfolio-dropdown .dropdown-list a:hover {
    background: linear-gradient(135deg, rgba(30, 136, 229, 0.12), rgba(30, 136, 229, 0.08));
}

.portfolio-dropdown .dropdown-list a:hover .service-name {
    color: var(--accent-blue);
}

.portfolio-dropdown .service-icon {
    font-size: 1.8rem;
}

/* CTA Button */
.cta-button {
    background: rgb(255, 101, 18) !important;
    color: #ffffff !important;
    padding: 0.75rem 2rem !important;
    border-radius: 8px !important;
    text-decoration: none !important;
    font-weight: 600 !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
    border: 2px solid transparent !important;
}

.cta-button:hover {
    background: linear-gradient(135deg, var(--accent-blue), var(--primary-blue)) !important;
    color: white !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(30, 136, 229, 0.4) !important;
    border-color: var(--accent-blue) !important;
}

.cta-button::after {
    display: none !important;
}

.nav-links > li:last-child {
    margin-left: 0.5rem;
}

/* Mobile Menu Button */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 1001;
}

.mobile-menu-btn span {
    width: 28px;
    height: 3px;
    background: var(--gray-dark);
    border-radius: 3px;
    transition: all 0.3s ease;
}

.mobile-menu-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.mobile-menu-btn.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* Mobile Menu Overlay */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 999;
}

.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Mobile Menu Panel */
.mobile-menu-panel {
    position: fixed;
    top: 0;
    right: -100%;
    width: 85%;
    max-width: 400px;
    height: 100%;
    background: #ffffff;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    overflow-y: auto;
}

.mobile-menu-panel.active {
    right: 0;
}

.mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    background: linear-gradient(135deg, rgba(30, 136, 229, 0.05), rgba(30, 136, 229, 0.02));
}

.mobile-logo {
    height: 80px;
    width: auto;
}

.mobile-menu-close {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    color: var(--gray-dark);
    transition: all 0.3s ease;
}

.mobile-menu-close:hover {
    transform: rotate(90deg);
    color: var(--accent-blue);
}

/* Mobile Navigation */
.mobile-nav-list {
    list-style: none;
    padding: 1rem;
    margin: 0;
}

.mobile-nav-item {
    margin-bottom: 0.5rem;
}

.mobile-nav-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    color: var(--gray-dark);
    text-decoration: none;
    font-weight: 500;
    font-size: 1rem;
    border-radius: 12px;
    transition: all 0.3s ease;
    background: transparent;
    border: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
}

.mobile-nav-link:hover {
    background: linear-gradient(135deg, rgba(30, 136, 229, 0.08), rgba(30, 136, 229, 0.04));
    color: var(--accent-blue);
    transform: translateX(4px);
}

.nav-icon {
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
}

.mobile-nav-cta {
    background: linear-gradient(135deg, var(--accent-blue), #1565C0) !important;
    color: white !important;
    margin-top: 1rem;
    box-shadow: 0 4px 16px rgba(30, 136, 229, 0.3);
}

.mobile-nav-cta:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 24px rgba(30, 136, 229, 0.4) !important;
}

/* ===== MOBILE DROPDOWN STYLES - CRITICAL FOR FUNCTIONALITY ===== */
.mobile-dropdown-arrow {
    transition: transform 0.3s ease;
    margin-left: auto;
}

.mobile-nav-link.active .mobile-dropdown-arrow {
    transform: rotate(180deg);
}

.mobile-services-dropdown {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(30, 136, 229, 0.03);
    border-radius: 8px;
    margin-top: 0.5rem;
}

.mobile-services-dropdown.active {
    max-height: 2000px;
    overflow-y: auto;
}

.mobile-services-group {
    padding: 0.75rem 1rem;
}

.mobile-services-group:not(:last-child) {
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.mobile-services-group-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--accent-blue);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.75rem;
}

.mobile-services-group a {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--gray-dark);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-size: 0.95rem;
}

.mobile-services-group a:hover,
.mobile-services-group a:active {
    background: linear-gradient(135deg, rgba(30, 136, 229, 0.12), rgba(30, 136, 229, 0.08));
    color: var(--accent-blue);
    transform: translateX(4px);
}

/* Mobile Portfolio Specific */
.mobile-view-all {
    display: block !important;
    text-align: center;
    padding: 1rem !important;
    background: linear-gradient(135deg, var(--accent-blue), var(--primary-blue)) !important;
    color: white !important;
    font-weight: 700 !important;
    border-radius: 8px !important;
    margin-top: 0.5rem;
    box-shadow: 0 4px 12px rgba(30, 136, 229, 0.3);
    text-decoration: none;
}

.mobile-view-all:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(30, 136, 229, 0.4);
}

/* Prevent body scroll when mobile menu is open */
body.mobile-menu-open {
    overflow: hidden;
}

/* Footer */
footer {
    background: var(--dark-navy);
    color: white;
    padding: 4rem 2rem 2rem;
}

.footer-container {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 1fr 2fr 1.5fr;
    gap: 4rem;
    margin-bottom: 3rem;
    align-items: start;
}

.footer-section {
    display: flex;
    flex-direction: column;
}

.footer-section h3 {
    margin-bottom: 1.5rem;
    font-size: 1.3rem;
    color: white;
    font-weight: 700;
}

.footer-logo {
    margin-bottom: 1.5rem;
}

.footer-logo img {
    height: 120px;
    width: auto;
    border-radius: 5px;
    background: white;
    padding: 5px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.footer-logo img:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.footer-section p,
.footer-section a {
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    line-height: 2;
    display: block;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.footer-section a:hover {
    color: var(--orange-accent);
    padding-left: 5px;
}

.footer-bottom {
    max-width: 1400px;
    margin: 0 auto;
    padding-top: 2rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    text-align: center;
    color: rgba(255,255,255,0.6);
    font-size: 0.9rem;
}

.footer-bottom a {
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-bottom a:hover {
    color: var(--orange-accent);
}

/* Common Page Elements */
.page-hero {
    margin-top: 80px;
    background: linear-gradient(135deg, var(--dark-navy), var(--primary-blue));
    color: white;
    padding: 3rem 2rem;
    text-align: center;
}

.page-hero h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.page-hero p {
    font-size: 1.1rem;
    opacity: 0.9;
}

.section-title {
    text-align: center;
    margin-bottom: 1rem;
}

.section-title h2 {
    font-size: 2.8rem;
    color: var(--primary-blue);
    margin-bottom: 0rem;
}

.section-title p {
    font-size: 1.2rem;
    color: var(--gray-medium);
}

/* Buttons */
.btn-primary {
    background: var(--orange-accent);
    color: white;
    padding: 1rem 2rem;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.btn-primary:hover {
    background: #FF8A5C;
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(255, 107, 53, 0.3);
}

.btn-secondary {
    background: transparent;
    color: white;
    padding: 1rem 2rem;
    border: 2px solid white;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.btn-secondary:hover {
    background: white;
    color: var(--primary-blue);
}

/* Responsive Design - Tablets */
@media (max-width: 1200px) {
    .portfolio-dropdown .dropdown-content {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 1024px) {
    .dropdown-menu {
        min-width: 800px;
    }
    
    .dropdown-content {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .logo {
        width: 100px !important;
        left: 15px !important;
    }
    
    .main-nav {
        padding-left: 100px !important;
    }
}

/* Responsive Design - Mobile */
@media (max-width: 768px) {
    .nav-links {
        display: none !important;
    }
    
    .mobile-menu-btn {
        display: flex !important;
    }

    .dropdown-menu {
        display: none !important;
    }

    .logo {
        width: 80px !important;
        left: 15px !important;
    }
    
    .main-nav {
        padding: 1rem;
        padding-left: 80px !important;
    }

    .page-hero h1 {
        font-size: 2rem;
    }

    .section-title h2 {
        font-size: 2rem;
    }

    .footer-container {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    /* Ensure mobile dropdowns work */
    .mobile-services-dropdown {
        display: block;
    }
    
    .mobile-services-dropdown.active {
        animation: slideDown 0.4s ease-out;
    }
}

@media (max-width: 480px) {
    .mobile-menu-panel {
        width: 90%;
    }

    .page-hero {
        padding: 2rem 1rem;
    }

    .page-hero h1 {
        font-size: 1.75rem;
    }

    .logo {
        width: 80px !important;
        left: 8px !important;
        top: 8px !important;
    }
    
    .logo img {
        padding: 5px !important;
        border-radius: 10px !important;
    }
    
    .main-nav {
        padding-left: 80px !important;
    }
    
    body.scrolled .logo {
        width: 80px !important;
    }

    
}

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

/* Only enable hover on devices that support hover */
@media (hover: hover) and (pointer: fine) {
    .nav-dropdown:hover .dropdown-menu {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transform: translateX(-50%) translateY(0);
    }
    
    .nav-dropdown:hover .dropdown-arrow {
        transform: rotate(180deg);
    }
}

/* Fix for iPhone/iPad - prevent hover states from sticking */
@media (hover: none) {
    .dropdown-menu {
        display: none !important;
    }
    
    .nav-links a:hover {
        color: var(--gray-dark) !important;
    }
    
    .nav-links a:active {
        color: var(--accent-blue) !important;
    }

    .nav-links a,
    .mobile-nav-link,
    .mobile-menu-btn {
        -webkit-user-select: none;
        user-select: none;
    }
}

/* iPhone/iPad specific fixes */
@supports (-webkit-touch-callout: none) {
    .dropdown-menu {
        -webkit-transform: translateX(-50%) translateY(10px);
    }
    
    @media (max-width: 768px) {
        .dropdown-menu {
            display: none !important;
            visibility: hidden !important;
            opacity: 0 !important;
        }
    }
    
    * {
        -webkit-tap-highlight-color: transparent;
    }
    
    .nav-links a,
    .dropdown-list a {
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }
}