/* CSS Variables */
:root {
    --cyan: #00d4ff;
    --light-cyan: #5de3ff;
    --dark-blue: #1a2332;
    --light-grey: #f2f3f5;
    --medium-grey: #d5dbdb;
    --text-dark: #16191f;
    --text-grey: #687078;
    --white: #ffffff;
    --orange: #ff9900;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--light-grey);
    color: var(--text-dark);
    line-height: 1.6;
}

/* HEADER */
header {
    background: var(--dark-blue);
    padding: 1.5rem 0;
}

.header-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 3rem;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 3rem;
}

.logo {
    height: 110px;
    width: auto;
}

/* Search */
.search-container {
    max-width: 800px;
    width: 100%;
    justify-self: center;
}

.search-wrapper {
    position: relative;
}

.search-bar {
    width: 100%;
    padding: 0.9rem 3.5rem 0.9rem 1.25rem;
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    font-size: 0.95rem;
    background: rgba(255, 255, 255, 0.08);
    color: white;
    transition: all 0.3s;
}

.search-bar::placeholder {
    color: rgba(255, 255, 255, 0.5);
    font-style: italic;
}

.search-bar:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--cyan);
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.2);
}

.search-icon {
    position: absolute;
    right: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.6);
    pointer-events: none;
}

/* Navigation */
.nav-links {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.nav-links a {
    color: var(--white);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    padding: 0.65rem 1.5rem;
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.2s;
    white-space: nowrap;
}

.nav-links a:hover {
    background: rgba(0, 212, 255, 0.15);
    border-color: var(--cyan);
    color: var(--cyan);
    transform: translateY(-2px);
}

/* Hero */
.hero {
    background: linear-gradient(180deg, var(--dark-blue) 0%, #2a3d52 100%);
    color: white;
    padding: 4rem 3rem;
    text-align: center;
    border-bottom: 3px solid var(--cyan);
    position: relative;
    overflow: hidden;
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 1100px;
    margin: 0 auto;
}

.hero-badge {
    display: inline-block;
    background: rgba(0, 212, 255, 0.15);
    border: 1px solid rgba(0, 212, 255, 0.3);
    color: var(--cyan);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    letter-spacing: 0.5px;
}

.hero h1 {
    font-size: 2.75rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
    line-height: 1.2;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #ffffff 0%, var(--cyan) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero p {
    font-size: 1.25rem;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.6;
    margin-bottom: 2rem;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-top: 2rem;
}

.stat {
    text-align: center;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--cyan);
    display: block;
}

.stat-label {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 0.25rem;
}

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

/* Featured Section */
.featured-section {
    background: var(--white);
    padding: 2rem;
    margin-bottom: 2rem;
    border: 1px solid var(--medium-grey);
    border-radius: 2px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--cyan);
}

.section-header h2 {
    font-size: 1.5rem;
    color: var(--text-dark);
    font-weight: 600;
}

.view-all {
    color: var(--cyan);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
}

.view-all:hover {
    text-decoration: underline;
}

.featured-content {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 2rem;
}

.featured-main {
    background: linear-gradient(135deg, #f0f9ff 0%, #ffffff 100%);
    padding: 2rem;
    border: 1px solid var(--medium-grey);
    border-left: 4px solid var(--cyan);
    cursor: pointer;
    transition: all 0.2s;
}

.featured-main:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.featured-label {
    background: var(--cyan);
    color: var(--white);
    padding: 0.25rem 0.75rem;
    border-radius: 2px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-block;
    margin-bottom: 1rem;
}

.featured-main h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-dark);
    font-weight: 600;
}

.featured-main p {
    color: var(--text-grey);
    line-height: 1.7;
    margin-bottom: 1rem;
}

.featured-meta {
    color: var(--text-grey);
    font-size: 0.85rem;
    font-weight: 500;
}

.featured-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.featured-item {
    background: var(--white);
    padding: 1.25rem;
    border: 1px solid var(--medium-grey);
    border-left: 3px solid var(--text-grey);
    cursor: pointer;
    transition: all 0.2s;
}

.featured-item:hover {
    border-left-color: var(--cyan);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.featured-item h4 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
    font-weight: 600;
}

.featured-item p {
    font-size: 0.875rem;
    color: var(--text-grey);
    margin-bottom: 0.5rem;
}

/* Service Cards */
.services-section {
    margin: 2rem 0;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
}

.service-card {
    background: var(--white);
    padding: 2rem;
    border: 1px solid var(--medium-grey);
    border-radius: 2px;
    transition: all 0.2s;
    cursor: pointer;
}

.service-card:hover {
    border-color: var(--cyan);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.service-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.service-card h3 {
    font-size: 1.35rem;
    margin-bottom: 1rem;
    color: var(--text-dark);
    font-weight: 600;
}

.service-card p {
    color: var(--text-grey);
    line-height: 1.7;
    font-size: 0.95rem;
}

/* CIPHER Highlight */
.cipher-highlight {
    background: linear-gradient(135deg, var(--dark-blue) 0%, #1a252f 100%);
    color: var(--white);
    padding: 3rem;
    margin: 2rem 0;
    border-radius: 2px;
    border-top: 4px solid var(--cyan);
}

.cipher-highlight h2 {
    font-size: 2.25rem;
    margin-bottom: 0.5rem;
}

.cipher-highlight .subtitle {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 1.5rem;
    font-style: italic;
}

.cipher-highlight p {
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 2rem;
    font-size: 1.05rem;
}

.cipher-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.cipher-box {
    background: rgba(255, 255, 255, 0.05);
    padding: 1.5rem;
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: 2px;
}

.cipher-box h4 {
    color: var(--cyan);
    margin-bottom: 0.75rem;
    font-size: 1rem;
    font-weight: 600;
}

.cipher-box p {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.9rem;
}

/* Footer */
footer {
    background: var(--dark-blue);
    color: var(--white);
    padding: 3rem 2rem;
    margin-top: 4rem;
    border-top: 4px solid var(--cyan);
}

.footer-container {
    max-width: 1400px;
    margin: 0 auto;
    text-align: center;
}

footer p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 1200px) {
    .header-container {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 0 1.5rem;
    }

    .logo {
        justify-self: center;
        height: 80px;
    }

    .search-container {
        max-width: 100%;
    }

    .search-bar {
        font-size: 0.9rem;
        padding: 0.75rem 3rem 0.75rem 1rem;
    }

    .nav-links {
        justify-content: center;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .nav-links a {
        font-size: 0.9rem;
        padding: 0.6rem 1.25rem;
    }

    .hero {
        padding: 3rem 1.5rem;
    }

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

    .hero p {
        font-size: 1rem;
    }

    .hero-stats {
        flex-direction: column;
        gap: 1.5rem;
    }

    .featured-content {
        grid-template-columns: 1fr;
    }
    
    .services-grid {
        grid-template-columns: 1fr;
    }

    .container {
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    .logo {
        height: 70px;
    }

    .hero h1 {
        font-size: 1.5rem;
    }

    .hero p {
        font-size: 0.95rem;
    }

    .hero-badge {
        font-size: 0.75rem;
        padding: 0.4rem 0.8rem;
    }

    .stat-number {
        font-size: 1.75rem;
    }
}

/* ========================================
   HIERARCHICAL DROPDOWN NAVIGATION
   ======================================== */

/* Primary Dropdown Menu (Level 1) */
.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-10px);
    background: white;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    padding: 8px 0;
    min-width: 240px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
    z-index: 1000;
    margin-top: 12px;
    list-style: none;
}

/* Show dropdown on hover */
.nav-item.has-dropdown:hover > .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* Dropdown Items */
.dropdown-item {
    position: relative;
}

.dropdown-item > .dropdown-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    color: #4a5568;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: background 0.2s ease, color 0.2s ease;
}

.dropdown-item > .dropdown-link:hover {
    background: #f7fafc;
    color: var(--cyan);
}

.submenu-icon {
    opacity: 0.4;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.dropdown-item:hover > .dropdown-link .submenu-icon {
    transform: translateX(3px);
    opacity: 1;
    color: var(--cyan);
}

/* Submenu (Level 2) - appears on category hover */
.submenu {
    position: absolute;
    top: 0;
    left: 100%;
    background: white;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    padding: 8px 0;
    min-width: 220px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
    transform: translateX(-10px);
    list-style: none;
    margin-left: 4px;
}

/* KEY: Only show submenu when DIRECT parent is hovered */
.dropdown-item.has-submenu:hover > .submenu {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

/* Submenu Links */
.submenu-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 16px;
    color: #4a5568;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.submenu-link:hover {
    background: #f7fafc;
    color: var(--cyan);
    transform: translateX(4px);
}

/* Badge styling */
.badge {
    display: inline-block;
    padding: 3px 8px;
    background: linear-gradient(135deg, #00d9ff 0%, #7b2cbf 100%);
    color: white;
    border-radius: 12px;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

/* Mobile Responsive Dropdown */
@media (max-width: 768px) {
    .dropdown-menu {
        position: static;
        transform: none;
        min-width: 100%;
        margin-top: 8px;
        box-shadow: none;
        border: 1px solid rgba(255, 255, 255, 0.1);
        background: rgba(255, 255, 255, 0.05);
        max-height: 0;
        overflow: hidden;
        padding: 0;
        opacity: 1;
        visibility: visible;
    }
    
    .nav-item.has-dropdown:hover > .dropdown-menu {
        transform: none;
        max-height: 500px;
        padding: 8px 0;
    }
    
    .dropdown-item > .dropdown-link {
        color: white;
    }
    
    .submenu {
        position: static;
        transform: none;
        margin-left: 0;
        padding-left: 16px;
        box-shadow: none;
        background: transparent;
        max-height: 0;
        overflow: hidden;
        opacity: 1;
        visibility: visible;
    }
    
    .dropdown-item.has-submenu:hover > .submenu {
        transform: none;
        max-height: 300px;
        padding: 8px 0 8px 16px;
    }
    
    .submenu-link {
        color: rgba(255, 255, 255, 0.8);
    }
    
    .submenu-link:hover {
        color: var(--cyan);
        background: transparent;
    }
}