/* ================================
   Dynamic Header Menu CSS - Custom Style
   White Background, Black Text, Blue Hover
   ================================ */

:root {
    --primary-color: #ffffff;           /* White background */
    --text-color: #000000;              /* Black text */
    --hover-color: #3498db;             /* Blue hover */
    --active-color: #3498db;            /* Blue active */
    --border-color: #3498db;            /* Blue border */
    --transition-speed: 0.3s;           /* Animation speed */
    --shadow-color: rgba(0, 0, 0, 0.1); /* Light shadow */
}

/* Header Main Container */
.custom-dynamic-header {
    background: var(--primary-color);
    box-shadow: 0 2px 8px var(--shadow-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 12px 0;
    border-bottom: 2px solid #e8e8e8;
}

.header-wrapper {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Logo Section */
.header-logo {
    flex-shrink: 0;
    margin-right: 30px;
    animation: slideInLeft 0.5s ease-out;
}

.logo-img {
    height: 50px;
    width: auto;
    transition: transform var(--transition-speed) ease;
    filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.15));
    border-radius: 4px;
}

.logo-img:hover {
    transform: scale(1.05);
}

/* Navigation Menu */
.header-nav {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    justify-content: center;
}

.nav-item {
    position: relative;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    border-radius: 6px;
    transition: all var(--transition-speed) ease;
    position: relative;
    overflow: hidden;
}

/* Hover Effect - Bottom Border Animation */
.nav-link::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--hover-color);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform var(--transition-speed) ease;
}

.nav-link:hover::before {
    transform: scaleX(1);
    transform-origin: left;
}

/* Hover State - Background Color Change */
.nav-link:hover {
    background: rgba(52, 152, 219, 0.1);
    color: var(--hover-color);
    transform: translateY(-2px);
}

/* Active Menu Item */
.nav-item.active .nav-link {
    background: rgba(52, 152, 219, 0.15);
    color: var(--active-color);
    border-bottom: 3px solid var(--active-color);
    font-weight: 600;
}

.nav-item.active .nav-link::before {
    display: none;
}

/* Icon Style */
.nav-icon {
    font-size: 16px;
    display: inline-block;
    transition: transform var(--transition-speed) ease;
}

.nav-link:hover .nav-icon {
    transform: scale(1.1);
}

.nav-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Blog Link Special Style */
.blog-link {
    margin-left: 10px;
    border-left: 2px solid #e0e0e0;
    padding-left: 24px;
}

.blog-link:hover {
    color: var(--hover-color);
    border-left-color: var(--hover-color);
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    margin-left: 20px;
    padding: 5px;
}

.mobile-menu-toggle span {
    width: 25px;
    height: 3px;
    background: var(--text-color);
    border-radius: 2px;
    transition: all var(--transition-speed) ease;
}

.mobile-menu-toggle:hover span {
    background: var(--hover-color);
}

/* ================================
   Animations
   ================================ */

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInMenu {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.nav-item {
    animation: slideInMenu 0.5s ease-out;
    animation-fill-mode: both;
}

.nav-item:nth-child(1) { animation-delay: 0.1s; }
.nav-item:nth-child(2) { animation-delay: 0.2s; }
.nav-item:nth-child(3) { animation-delay: 0.3s; }
.nav-item:nth-child(4) { animation-delay: 0.4s; }
.nav-item:nth-child(5) { animation-delay: 0.5s; }

/* ================================
   Responsive Design
   ================================ */

/* Tablet (768px to 1024px) */
@media (max-width: 1024px) {
    .header-wrapper {
        padding: 0 15px;
    }

    .nav-menu {
        gap: 2px;
    }

    .nav-link {
        padding: 8px 12px;
        font-size: 13px;
    }

    .nav-icon {
        font-size: 14px;
    }

    .logo-img {
        height: 45px;
    }
}

/* Mobile (max-width 768px) */
@media (max-width: 768px) {
    .header-wrapper {
        flex-wrap: wrap;
        padding: 10px 15px;
    }

    .header-logo {
        margin-right: 15px;
        flex-basis: auto;
    }

    .logo-img {
        height: 40px;
    }

    .header-nav {
        order: 3;
        width: 100%;
        margin-top: 15px;
    }

    .nav-menu {
        flex-direction: column;
        gap: 0;
        width: 100%;
        background: #f9f9f9;
        border: 1px solid #e0e0e0;
        border-radius: 8px;
        overflow: hidden;
        display: none;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    }

    .nav-menu.active {
        display: flex;
    }

    .nav-item {
        width: 100%;
        border-bottom: 1px solid #e0e0e0;
    }

    .nav-item:last-child {
        border-bottom: none;
    }

    .nav-link {
        width: 100%;
        padding: 12px 16px;
        border-radius: 0;
        font-size: 14px;
        color: var(--text-color);
    }

    .nav-link::before {
        display: none;
    }

    .nav-link:hover {
        background: rgba(52, 152, 219, 0.1);
        color: var(--hover-color);
        border-left: 4px solid var(--hover-color);
        padding-left: 12px;
    }

    .blog-link {
        border-left: none;
        padding-left: 16px;
    }

    .blog-link:hover {
        border-left: 4px solid var(--hover-color);
        padding-left: 12px;
    }

    /* Mobile Menu Toggle Show */
    .mobile-menu-toggle {
        display: flex;
        order: 2;
    }

    .mobile-menu-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translateY(12px);
        background: var(--hover-color);
    }

    .mobile-menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }

    .mobile-menu-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translateY(-12px);
        background: var(--hover-color);
    }
}

/* Small Mobile (max-width 480px) */
@media (max-width: 480px) {
    .header-wrapper {
        padding: 8px 10px;
    }

    .header-logo {
        margin-right: 10px;
    }

    .logo-img {
        height: 35px;
    }

    .nav-link {
        padding: 10px 12px;
        font-size: 12px;
    }

    .nav-icon {
        font-size: 13px;
    }

    .nav-text {
        display: none;
    }

    .nav-item.active .nav-text {
        display: inline;
    }

    .blog-link .nav-text {
        display: inline;
    }
}

/* ================================
   Dark Mode Support
   ================================ */

@media (prefers-color-scheme: dark) {
    :root {
        --primary-color: #ffffff;
        --text-color: #000000;
        --shadow-color: rgba(0, 0, 0, 0.2);
    }

    .custom-dynamic-header {
        background: var(--primary-color);
    }

    .nav-menu {
        background: #f5f5f5;
    }
}

/* ================================
   Accessibility
   ================================ */

.nav-link:focus {
    outline: 2px solid var(--hover-color);
    outline-offset: 2px;
}

.mobile-menu-toggle:focus {
    outline: 2px solid var(--hover-color);
    outline-offset: 2px;
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .logo-img,
    .nav-link,
    .nav-link::before,
    .mobile-menu-toggle span,
    .nav-item,
    .nav-icon {
        animation: none;
        transition: none;
    }
}

/* ================================
   Ripple Effect on Click
   ================================ */

.nav-link {
    position: relative;
    overflow: hidden;
}

.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(52, 152, 219, 0.5);
    transform: scale(0);
    animation: ripple-animation 0.6s ease-out;
    pointer-events: none;
}

@keyframes ripple-animation {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* ================================
   Additional Styling
   ================================ */

/* Smooth transitions for all elements */
.custom-dynamic-header * {
    transition: var(--transition-speed) ease;
}

/* Prevent text selection on header */
.header-nav,
.header-logo {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* Better focus visibility */
.nav-link:focus-visible {
    outline: 3px solid var(--hover-color);
    outline-offset: 2px;
}

/* Smooth scrolling behavior */
html {
    scroll-behavior: smooth;
}

/* ================================
   Print Styles
   ================================ */

@media print {
    .custom-dynamic-header {
        position: static;
        box-shadow: none;
    }

    .mobile-menu-toggle {
        display: none;
    }

    .nav-menu {
        display: flex !important;
    }
}