/* =========================================
   Z Laser Tudásbázis – Fő stíluslap
   v1.0
   ========================================= */

/* --- Változók --- */
:root {
    --primary:       #e63946;   /* céges piros/narancs akcentus */
    --primary-dark:  #c1121f;
    --sidebar-bg:    #1a1a2e;
    --sidebar-hover: #16213e;
    --sidebar-active:#e63946;
    --sidebar-width: 260px;
    --header-height: 56px;
    --text-main:     #212529;
    --text-muted:    #6c757d;
    --border:        #dee2e6;
    --bg-content:    #f8f9fa;
    --card-bg:       #ffffff;
    --font-main:     'Barlow', sans-serif;
    --transition:    0.2s ease;
}

/* --- Alap --- */
* { box-sizing: border-box; }
body {
    font-family: var(--font-main);
    background: var(--bg-content);
    color: var(--text-main);
    margin: 0;
    padding: 0;
    font-size: 15px;
    line-height: 1.65;
}

/* =========================================
   HEADER
   ========================================= */
#main-header {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--header-height);
    background: var(--sidebar-bg);
    z-index: 1040;
    display: flex;
    align-items: center;
    padding: 0 1.25rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.35);
}

#main-header .brand {
    color: #fff;
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: .04em;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: .55rem;
}

#main-header .brand span.accent {
    color: var(--primary);
}

#main-header .brand .logo-icon {
    width: 28px;
    height: 28px;
    background: var(--primary);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .85rem;
    font-weight: 900;
    color: #fff;
    flex-shrink: 0;
}

/* hamburger gomb (mobile) */
#sidebar-toggle {
    display: none;
    background: none;
    border: none;
    color: #fff;
    font-size: 1.3rem;
    cursor: pointer;
    margin-right: .75rem;
    padding: .2rem .4rem;
}

/* Nyelvváltó */
.lang-switcher {
    margin-left: auto;
    display: flex;
    gap: .35rem;
    align-items: center;
}
.lang-btn {
    color: rgba(255,255,255,.55);
    text-decoration: none;
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: .03em;
    padding: .25rem .55rem;
    border-radius: 5px;
    border: 1px solid transparent;
    transition: color var(--transition), background var(--transition), border-color var(--transition);
}
.lang-btn:hover {
    color: #fff;
    background: rgba(255,255,255,.08);
}
.lang-btn.active {
    color: #fff;
    background: var(--primary);
    border-color: var(--primary);
}

/* Verziószám a fejlécben */
.header-version {
    color: rgba(255,255,255,.4);
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .04em;
    margin-right: .35rem;
}

/* =========================================
   SIDEBAR / NAV
   ========================================= */
#sidebar {
    position: fixed;
    top: var(--header-height);
    left: 0;
    width: var(--sidebar-width);
    height: calc(100vh - var(--header-height));
    background: var(--sidebar-bg);
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 1030;
    transition: transform var(--transition);
    scrollbar-width: thin;
    scrollbar-color: #333 transparent;
    padding-bottom: 2rem;
}

#sidebar::-webkit-scrollbar { width: 4px; }
#sidebar::-webkit-scrollbar-thumb { background: #333; border-radius: 2px; }

/* Keresősáv a navban */
#sidebar .sidebar-search {
    padding: .75rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,.07);
}

#sidebar .sidebar-search input {
    width: 100%;
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 6px;
    color: #fff;
    padding: .4rem .75rem;
    font-size: .85rem;
    outline: none;
    transition: border-color var(--transition);
}
#sidebar .sidebar-search input::placeholder { color: rgba(255,255,255,.4); }
#sidebar .sidebar-search input:focus { border-color: var(--primary); }

/* Gép-kategória fejléc (accordion toggle) */
.nav-category-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: none;
    border: none;
    color: rgba(255,255,255,.75);
    font-family: var(--font-main);
    font-weight: 600;
    font-size: .8rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    padding: .85rem 1rem .55rem;
    cursor: pointer;
    transition: color var(--transition);
}
.nav-category-btn:hover { color: #fff; }
.nav-category-btn .chevron {
    font-size: .7rem;
    transition: transform var(--transition);
    opacity: .5;
}
.nav-category-btn.open .chevron { transform: rotate(180deg); }

/* Alcikkek */
.nav-sub {
    list-style: none;
    margin: 0;
    padding: 0 0 .5rem;
    overflow: hidden;
    max-height: 0;
    transition: max-height .25s ease;
}
.nav-sub.open { max-height: 300px; }

.nav-sub li a {
    display: flex;
    align-items: center;
    gap: .55rem;
    padding: .45rem 1rem .45rem 2rem;
    color: rgba(255,255,255,.58);
    text-decoration: none;
    font-size: .88rem;
    border-left: 3px solid transparent;
    transition: color var(--transition), border-color var(--transition), background var(--transition);
}
.nav-sub li a:hover {
    color: #fff;
    background: rgba(255,255,255,.05);
}
.nav-sub li a.active {
    color: #fff;
    border-left-color: var(--primary);
    background: rgba(230,57,70,.12);
}
.nav-sub li a .nav-icon { font-size: .8rem; opacity: .7; }

/* Elválasztó */
.nav-divider {
    border: none;
    border-top: 1px solid rgba(255,255,255,.07);
    margin: .5rem 0;
}

/* Erősebb elválasztó blokkok között (Általános/Munkamenetek után) */
.nav-block-divider {
    border-top: 3px solid rgba(255,255,255,.45);
    margin: 1.1rem 0;
}

/* =========================================
   FŐ TARTALOM
   ========================================= */
#main-content {
    margin-left: var(--sidebar-width);
    margin-top: var(--header-height);
    padding: 2rem 2.25rem 3rem;
    min-height: calc(100vh - var(--header-height));
    max-width: 960px;
}

/* Oldal fejléc */
.page-header {
    border-bottom: 2px solid var(--border);
    padding-bottom: .85rem;
    margin-bottom: 1.75rem;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}
.page-header h1 {
    font-size: 1.55rem;
    font-weight: 700;
    margin: 0;
    color: var(--text-main);
}
.page-header .version-badge {
    font-size: .75rem;
    background: var(--sidebar-bg);
    color: rgba(255,255,255,.75);
    padding: .2rem .65rem;
    border-radius: 20px;
    font-weight: 600;
    letter-spacing: .04em;
    flex-shrink: 0;
}

/* Breadcrumb */
.breadcrumb-wrap {
    margin-bottom: 1.2rem;
    font-size: .83rem;
    color: var(--text-muted);
}
.breadcrumb-wrap a { color: var(--primary); text-decoration: none; }
.breadcrumb-wrap a:hover { text-decoration: underline; }
.breadcrumb-wrap .sep { margin: 0 .4rem; opacity: .5; }

/* Kártyák */
.content-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.5rem 1.75rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 4px rgba(0,0,0,.05);
}
.content-card h2 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    padding-bottom: .5rem;
    border-bottom: 1px solid var(--border);
    color: var(--sidebar-bg);
}
.content-card h3 {
    font-size: .98rem;
    font-weight: 700;
    margin-top: 1.25rem;
    color: var(--text-main);
}

/* Figyelmeztetés dobozok */
.alert-box {
    border-radius: 6px;
    padding: .85rem 1.1rem;
    margin-bottom: 1rem;
    font-size: .9rem;
    display: flex;
    gap: .65rem;
    align-items: flex-start;
}
.alert-box .icon { font-size: 1rem; flex-shrink: 0; margin-top: .05rem; }
.alert-box.warning { background: #fff3cd; border-left: 4px solid #ffc107; color: #856404; }
.alert-box.danger  { background: #f8d7da; border-left: 4px solid #dc3545; color: #842029; }
.alert-box.info    { background: #d1ecf1; border-left: 4px solid #0dcaf0; color: #0c5460; }
.alert-box.success { background: #d1e7dd; border-left: 4px solid #198754; color: #0a3622; }

/* Táblázatok */
.content-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .88rem;
    margin-bottom: .5rem;
}
.content-table th {
    background: var(--sidebar-bg);
    color: #fff;
    padding: .55rem .85rem;
    text-align: left;
    font-weight: 600;
    font-size: .8rem;
    letter-spacing: .04em;
    text-transform: uppercase;
}
.content-table td {
    padding: .55rem .85rem;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}
.content-table tr:last-child td { border-bottom: none; }
.content-table tr:nth-child(even) td { background: #f8f9fa; }
.content-table tr:hover td { background: #f1f3f5; }

/* Hibakód badge */
.error-code {
    display: inline-block;
    font-family: 'Courier New', monospace;
    font-size: .78rem;
    font-weight: 700;
    background: var(--sidebar-bg);
    color: var(--primary);
    padding: .1rem .45rem;
    border-radius: 4px;
    letter-spacing: .04em;
}

/* Lépések lista */
.steps-list {
    counter-reset: step;
    list-style: none;
    padding: 0;
    margin: 0;
}
.steps-list li {
    counter-increment: step;
    display: flex;
    gap: 1rem;
    margin-bottom: .85rem;
    align-items: flex-start;
}
.steps-list li::before {
    content: counter(step);
    min-width: 26px;
    height: 26px;
    background: var(--primary);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .78rem;
    font-weight: 700;
    flex-shrink: 0;
    margin-top: .1rem;
}

/* =========================================
   KERESÉS KIEMELÉS
   ========================================= */
.search-highlight {
    background: #fff176;
    border-radius: 2px;
    padding: 0 2px;
}

/* Keresési eredmény overlay */
#search-results-panel {
    display: none;
    position: fixed;
    top: var(--header-height);
    left: var(--sidebar-width);
    right: 0;
    background: var(--card-bg);
    z-index: 1020;
    padding: 1.5rem 2.25rem;
    min-height: calc(100vh - var(--header-height));
    overflow-y: auto;
}
#search-results-panel h2 { font-size: 1.1rem; margin-bottom: 1rem; }
.search-result-item {
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: .85rem 1rem;
    margin-bottom: .75rem;
    text-decoration: none;
    display: block;
    color: var(--text-main);
    transition: border-color var(--transition), box-shadow var(--transition);
}
.search-result-item:hover {
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(230,57,70,.15);
}
.search-result-item .result-title { font-weight: 700; margin-bottom: .2rem; }
.search-result-item .result-path { font-size: .78rem; color: var(--text-muted); margin-bottom: .4rem; }
.search-result-item .result-excerpt { font-size: .85rem; color: var(--text-muted); }

/* =========================================
   FOOTER
   ========================================= */
#main-footer {
    margin-left: var(--sidebar-width);
    background: #fff;
    border-top: 1px solid var(--border);
    padding: .85rem 2.25rem;
    font-size: .8rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

/* =========================================
   KEZDŐLAP – gépkártyák
   ========================================= */
.machine-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.25rem;
    margin-top: 1.5rem;
}
.machine-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.5rem;
    text-decoration: none;
    color: var(--text-main);
    transition: box-shadow var(--transition), border-color var(--transition), transform var(--transition);
    display: flex;
    flex-direction: column;
    gap: .5rem;
}
.machine-card:hover {
    box-shadow: 0 4px 18px rgba(0,0,0,.1);
    border-color: var(--primary);
    transform: translateY(-2px);
    color: var(--text-main);
}
.machine-card .mc-icon {
    font-size: 1.8rem;
    margin-bottom: .25rem;
}
.machine-card .mc-name {
    font-weight: 700;
    font-size: 1rem;
}
.machine-card .mc-desc {
    font-size: .82rem;
    color: var(--text-muted);
}
.machine-card .mc-links {
    margin-top: .5rem;
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
}
.machine-card .mc-links span {
    font-size: .75rem;
    background: var(--bg-content);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: .1rem .45rem;
    color: var(--text-muted);
}

/* =========================================
   RESZPONZÍV – MOBILE
   ========================================= */
@media (max-width: 768px) {
    #sidebar-toggle { display: block; }

    #sidebar {
        transform: translateX(-100%);
        z-index: 1035;
    }
    #sidebar.open {
        transform: translateX(0);
    }

    /* overlay a sidebar mögé mobilon */
    #sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,.45);
        z-index: 1034;
    }
    #sidebar-overlay.show { display: block; }

    #main-content {
        margin-left: 0;
        padding: 1.25rem 1rem 2rem;
    }

    #main-footer {
        margin-left: 0;
    }

    #search-results-panel {
        left: 0;
        padding: 1.25rem 1rem;
    }

    .page-header h1 { font-size: 1.25rem; }

    /* Előnyök/hátrányok grid mobilon egymás alá kerül */
    .pros-cons-grid {
        grid-template-columns: 1fr !important;
    }
}
