/* 
 * Thot Navigation Bar 
 * Optimized Technical Structure (Visuals Preserved)
 */

:root {
    --thot-nav-height: 70px;
    --thot-primary: #4f46e5;
    --thot-border-light: #f1f5f9;
    --thot-bg-active: #F1F0FF;
    --thot-bg-current: #EBE9FE;
    --thot-text-dark: #1e293b;
    --thot-text-muted: #475569;
}

body.thot-menu-open {
    overflow: hidden;
}

.thot-nav-bar {
    background: #ffffff;
    height: var(--thot-nav-height);
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
    width: 100%;
    z-index: 9999;
    font-family: 'Poppins', sans-serif;
}

.thot-nav-container {
    position: relative;
    max-width: 1280px;
    width: 100%;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    height: 100%;
}

.thot-nav-logo img { height: 45px; margin-right: 40px; }

.thot-nav-list {
    display: flex;
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    height: var(--thot-nav-height);
}

.thot-nav-item { height: 100%; display: flex; align-items: center; }

.thot-nav-link {
    text-decoration: none;
    color: #000;
    font-weight: 500;
    font-size: 14px;
    padding: 0 1.25rem;
    display: flex;
    align-items: center;
    gap: 8px;
    height: 100%;
    transition: 0.2s;
}

.thot-nav-link:hover,
.thot-nav-item.is-current > .thot-nav-link { color: var(--thot-primary); }

.thot-nav-icon { height: 20px; }
.thot-nav-chevron { font-size: 10px; margin-top: 2px; color: #94a3b8; transition: 0.2s; }
.thot-nav-item:hover .thot-nav-chevron { transform: rotate(180deg); }

/* Megamenu Full-Width */
.thot-megamenu {
    position: absolute;
    top: var(--thot-nav-height);
    left: 0;    
    width: 96vw;
    background: #ffffff;
    border-top: 1px solid var(--thot-border-light);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    pointer-events: none;
}

.thot-nav-item:hover .thot-megamenu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.thot-megamenu-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 3rem;
}

.thot-megamenu-grid {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 4rem;
}

/* Item Lists */
.thot-l2-list, .thot-l3-list { list-style: none !important; margin: 0 !important; padding: 0 !important; }
.thot-l2-item, .thot-l3-item { margin-bottom: 1rem; cursor: pointer; position: relative; }
.thot-l3-item:last-child { margin-bottom: 0; }

.thot-item-card-wrapper { 
    display: block; 
    text-decoration: none; 
    color: inherit; 
    text-align: left;
}

.thot-item-card {
    padding: 1.5rem;
    background: #ffffff;
    border: 1px solid var(--thot-border-light) !important;
    border-radius: 10px;
    transition: all 0.2s;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.thot-item-card.thot-has-link { padding-right: 3.5rem; }

.thot-item-card.thot-item-more {
    height: 50px;
    padding: 0 3.5rem 0 1.5rem;
    background: transparent !important;
    border: solid 2px #F7F6FB !important;
    justify-content: center;    
}
.thot-item-card.thot-item-more .thot-item-title {
    font-weight: 400;
    font-size: 0.9rem;
}
.thot-item-card.thot-item-more:hover {
    background: #F7F6FB !important;
}

/* Interaction Highlights */
/* 1. Hover state */
.thot-l2-item:hover > .thot-item-card-wrapper > .thot-item-card, 
.thot-l3-item:hover > .thot-item-card-wrapper > .thot-item-card { 
    background: #f8fafc; 
    border-color: #e2e8f0 !important;
}

/* 2. Active Tab state */
.thot-l2-item.has-sub-items.is-active > .thot-item-card-wrapper > .thot-item-card { 
    background: var(--thot-bg-active); 
    border-color: #E0DEFF !important;
}

/* 3. Current Page state */
.thot-l2-item.is-current > .thot-item-card-wrapper > .thot-item-card, 
.thot-l3-item.is-current > .thot-item-card-wrapper > .thot-item-card { 
    background: var(--thot-bg-current); 
    border-color: var(--thot-primary) !important;
    box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.1);
}

.thot-l2-item.is-current .thot-item-title, 
.thot-l3-item.is-current .thot-item-title { color: var(--thot-primary); }

.thot-item-title { font-weight: 700; color: var(--thot-text-dark); font-size: 16px; display: block; }
.thot-item-preview { font-size: 14px; color: var(--thot-text-muted); margin: 0; line-height: 1.5; }

/* Circular Arrow for links */
.thot-item-card::after {
    content: '>';
    display: flex;
    align-items: center;
    justify-content: center;    
    position: absolute;    
    right: 10px;
    top: 50%;
    width: 16px;
    height: 16px;
    transform: translateY(-50%);
    font-size: 16px;
    font-weight: 400;
    color: #818CF8;
    border: solid 1px #818CF8;
    border-radius: 50%;
}

.thot-item-card.thot-has-link::after {
    content: ' ';
    background-image: url('../img/ui/arrow-top.svg');
    background-repeat: no-repeat;
    background-position: center;
    background-size: 60% 60%;
    filter: brightness(0) saturate(100%) invert(59%) sepia(33%) saturate(1137%) hue-rotate(203deg) brightness(96%) contrast(90%);
    right: 10px;
    top: 20px;
    width: 24px;
    height: 24px;
    transform: translateY(-50%) rotate(45deg);    
    border: none; 
}

/* Content Pane */
.thot-pane { 
    display: none; 
    animation: thotFadeIn 0.4s ease forwards;
}

.thot-pane.is-active { display: block; }

@keyframes thotFadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Generic Content View */
.thot-content-view {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2.5rem;
    background: #F7F6FB;
    border-radius: 10px;
    padding: 2.5rem;
}

.thot-content-media { width: 100%; border: solid 1px black; border-radius: 10px; }
.thot-content-img {
    width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    display: block;
}
.thot-content-desc { color: var(--thot-text-dark); font-size: 1rem; line-height: 1.4; margin: 0 auto; max-width: 800px; }

/* Burger Menu Styles */
.thot-burger {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 44px;
    height: 44px;
    background: transparent;
    border: solid 1px #EBEBF4;
    border-radius: 5px;
    cursor: pointer;
    padding: 12px 10px;
    z-index: 10001;
    margin-right: -10px;
}

.thot-burger:hover { background: var(--thot-bg-current); }
.thot-burger-line { width: 100%; height: 2px; background-color: #000; transition: all 0.3s ease; transform-origin: center; }

/* Mobile styles (< 980px) */
@media (max-width: 980px) {
    .thot-burger { display: flex !important; gap: inherit; }
    .thot-nav-container { padding: 0 1.5rem; }

    .thot-nav-content {
        position: absolute;
        top: var(--thot-nav-height);
        left: 0;
        width: 100vw;
        height: calc(100vh - var(--thot-nav-height));
        background: #fff;
        display: none;
        flex-direction: column;
        overflow-y: auto;
        z-index: 10000;
    }

    .thot-nav-content.is-active { display: flex; }
    .thot-nav-list { flex-direction: column; height: auto; width: 100%; }
    .thot-nav-item { width: 100%; flex-direction: column; align-items: flex-start; height: auto; }

    .thot-nav-link {
        width: 100%;
        padding: 1.25rem 1.5rem;
        display: flex;
        align-items: center;
        justify-content: flex-start;
        border-bottom: 1px solid var(--thot-border-light);
        height: auto;
        background: #fff;
    }

    .thot-nav-link span { margin-right: auto; }
    .thot-nav-chevron { transition: transform 0.3s ease; margin-left: 10px; }
    .thot-nav-item.is-expanded > .thot-nav-link .thot-nav-chevron { transform: rotate(180deg); }

    /* Megamenu on mobile */
    .thot-megamenu { position: static; width: 100%; opacity: 1; visibility: visible; transform: none; display: none; box-shadow: none; border: none; padding: 0; pointer-events: auto; }
    .thot-nav-item.is-expanded .thot-megamenu { display: block; }
    .thot-megamenu-container { padding: 0; }
    .thot-megamenu-grid { display: flex; flex-direction: column; gap: 0; }
    .thot-col { width: 100%; }

    /* L2 Items on Mobile */
    .thot-l2-item { margin-bottom: 0; border-bottom: 1px solid var(--thot-border-light); background: #fff; position: relative; }
    .thot-l2-item.is-active { background: #fff; }

    /* Chevron for L2 items */
    .thot-l2-item.has-sub-items::after {
        content: '\f078'; font-family: 'Font Awesome 5 Free'; font-weight: 900;
        position: absolute; right: 1.5rem; top: 1.5rem; font-size: 10px; color: #94a3b8;
        transition: transform 0.3s ease; pointer-events: none;
    }
    .thot-l2-item.has-sub-items.is-active::after { transform: rotate(180deg); }
    .thot-l2-item:not(.has-sub-items)::after { display: none; }

    /* Content Panes on Mobile */
    .thot-megamenu-grid > .thot-col:last-child { display: none; }
    .thot-pane { display: none; padding: 1.5rem; background: #f8fafc; border-bottom: 1px solid var(--thot-border-light); }
    .thot-l2-item.is-active .thot-pane { display: block; }

    /* L3 Tool cards on mobile */
    .thot-l3-item .thot-item-card { background: #fff; border-radius: 8px; border: 1px solid #e2e8f0 !important; padding: 1rem; }
    .thot-item-card { background: transparent; padding: 1.25rem 1.5rem; border-radius: 0; gap: 0; position: relative; border: none !important; }
    .thot-item-card::after { display: none; }
    
    .thot-item-title { font-size: 14px; font-weight: 600; color: var(--thot-text-dark); }
    .thot-item-preview { display: block; font-size: 12px; color: var(--thot-text-muted); margin-top: 4px; }

    /* Burger animation */
    .thot-burger.is-active .thot-burger-line:nth-child(1) { transform: translateY(8px) rotate(45deg); }
    .thot-burger.is-active .thot-burger-line:nth-child(2) { opacity: 0; }
    .thot-burger.is-active .thot-burger-line:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }
}
