/* ============================================================
   M1 Support — Sidebar + Topbar CSS
   public/style/nav.css
   ============================================================ */

/* ── Gyökér layout ────────────────────────────────────────── */

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

body {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

.m1-layout {
    display: flex;
    min-height: 100vh;
    background: #f0f2f5;
}

/* Az oldal fő tartalma a sidebar mellett */
.m1-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

/* ── Sidebar ──────────────────────────────────────────────── */

.m1-sidebar {
    width: 240px;
    min-height: 100vh;
    background: #1a2236;
    border-right: 1px solid #2d3a52;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    scrollbar-width: none;
    z-index: 100;
}

.m1-sidebar::-webkit-scrollbar {
    display: none;
}

/* Logo blokk */
.m1-sidebar__header {
    padding: 0 20px;
    height: 72px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    flex-shrink: 0;
    background: transparent;
    position: relative;
    overflow: visible;
    z-index: 10;
}

.m1-sidebar__logo-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    user-select: none;
    overflow: hidden;
}

.m1-sidebar__logo-icon img {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

/* Glass pane — logó + szöveg, kimegy a sidebar széléig */
.m1-sidebar__header-glass {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(15, 22, 35, 0.55);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 0 12px 12px 0;
    padding: 8px 16px 8px 20px;
    margin-left: -20px;
    margin-right: 0;
    padding-left: 24px;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.25),
                inset 0 1px 0 rgba(255, 255, 255, 0.06);
    position: relative;
    z-index: 1;
    width: calc(100% + 20px);
}

/* Behajlás effekt a bal szélen */
.m1-sidebar__header-glass::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 20px;
    height: 100%;
    background: linear-gradient(
        to right,
        rgba(0, 0, 0, 0.35) 0%,
        rgba(0, 0, 0, 0.0) 100%
    );
    border-radius: 0 0 0 0;
    pointer-events: none;
}

.m1-sidebar__logo-title {
    font-size: 13px;
    font-weight: 500;
    color: #e2eff8;
    line-height: 1.2;
}

.m1-sidebar__logo-sub {
    font-size: 11px;
    color: #5a7a99;
    margin-top: 2px;
}

/* Bejelentkezett user */
.m1-sidebar__user {
    padding: 13px 20px;
    border-bottom: 1px solid #2d3a52;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.m1-sidebar__avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #253347;
    border: 1.5px solid #3a4e68;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    color: #f5c842;
    flex-shrink: 0;
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s;
}

.m1-sidebar__avatar:hover {
    background: #2d3d54;
    border-color: #f5c842;
}

.m1-sidebar__user-name {
    font-size: 13px;
    font-weight: 500;
    color: #c8dff0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.m1-sidebar__user-rank {
    font-size: 11px;
    color: #5a7a99;
    margin-top: 1px;
}

/* Navigációs lista */
.m1-sidebar__nav {
    flex: 1;
    padding: 0;
    overflow-y: auto;
    scrollbar-width: none;
}

.m1-sidebar__nav::-webkit-scrollbar {
    display: none;
}

/* Szekció label */
.m1-sidebar__label {
    display: block;
    font-size: 10.5px;
    font-weight: 600;
    color: #5a7a99;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding: 12px 20px 4px 23px;
    margin-top: 0;
    border-left: 3px solid transparent;
}

.m1-sidebar__label:first-child {
    padding-top: 8px;
}

/* Nav elem */
.m1-sidebar__item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 20px;
    color: #8caac7;
    font-size: 13px;
    text-decoration: none;
    border-left: 3px solid transparent;
    transition: background 0.12s, color 0.12s;
    cursor: pointer;
}

.m1-sidebar__item i {
    font-size: 16px;
    flex-shrink: 0;
    width: 18px;
    text-align: center;
}

.m1-sidebar__item:hover {
    background: #253347;
    color: #c8dff0;
    text-decoration: none;
}

.m1-sidebar__item--active,
.m1-sidebar__item--active:hover {
    background: #2d3d54;
    color: #f5c842;
    border-left-color: #f5c842;
}

.m1-sidebar__item--active i {
    color: #f5c842;
}

/* Sub-item (összecsukható csoport alatt) */
.m1-sidebar__item--sub {
    padding-left: 46px;
    font-size: 12.5px;
}

/* Összecsukható csoport */
.m1-sidebar__group-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 20px;
    background: none;
    border: none;
    border-left: 3px solid transparent;
    color: #8caac7;
    font-size: 13px;
    cursor: pointer;
    text-align: left;
    transition: background 0.12s, color 0.12s;
}

.m1-sidebar__group-toggle i {
    font-size: 16px;
    flex-shrink: 0;
    width: 18px;
    text-align: center;
}

.m1-sidebar__chevron {
    margin-left: auto !important;
    width: auto !important;
    font-size: 13px !important;
    transition: transform 0.2s ease;
}

.m1-sidebar__group-toggle:hover {
    background: #253347;
    color: #c8dff0;
}

.m1-sidebar__group-toggle[aria-expanded="true"] {
    color: #c8dff0;
}

.m1-sidebar__group-toggle[aria-expanded="true"] .m1-sidebar__chevron {
    transform: rotate(180deg);
}

.m1-sidebar__group-body {
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.22s ease;
}

/* Lábléc */
.m1-sidebar__footer {
    border-top: 1px solid #2d3a52;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    gap: 8px;
}

.m1-sidebar__version {
    font-size: 11px;
    color: #5a7a99;
}

.m1-sidebar__logout {
    display: flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: 1px solid #3a4e68;
    border-radius: 6px;
    padding: 5px 10px;
    color: #8caac7;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    white-space: nowrap;
}

.m1-sidebar__logout:hover {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #991b1b;
}

/* Mobil overlay */
.m1-sidebar__overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 99;
}

.m1-sidebar__overlay.is-open {
    display: block;
}

/* ── Topbar ───────────────────────────────────────────────── */

.m1-topbar {
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    height: 72px;
    padding: 0 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    position: sticky;
    top: 0;
    z-index: 50;
    flex-shrink: 0;
}

/* Hamburger – mobilon látszik csak */
.m1-topbar__hamburger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    color: #374151;
    font-size: 22px;
    padding: 4px 6px;
    border-radius: 6px;
    line-height: 1;
    transition: background 0.12s;
}

.m1-topbar__hamburger:hover {
    background: #f3f4f6;
}

.m1-topbar__breadcrumb {
    flex: 1;
    min-width: 0;
}

.m1-topbar__page-title {
    font-size: 14px;
    font-weight: 500;
    color: #111111;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Raktár jelző */
.m1-topbar__storage {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 8px;
    padding: 5px 12px;
    font-size: 12px;
    color: #78350f;
    white-space: nowrap;
    flex-shrink: 0;
}

.m1-topbar__storage i {
    font-size: 14px;
}

.m1-topbar__storage-bar {
    width: 72px;
    height: 5px;
    background: #fde68a;
    border-radius: 3px;
    overflow: hidden;
}

.m1-topbar__storage-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.4s ease;
}

/* ── Reszponzív (mobil) ───────────────────────────────────── */

@media (max-width: 768px) {

    .m1-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        z-index: 100;
    }

    .m1-sidebar.is-open {
        transform: translateX(0);
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.4);
    }

    .m1-topbar__hamburger {
        display: flex;
        align-items: center;
    }

    .m1-topbar__storage {
        display: none;
    }

    .m1-content {
        /* mobilon nincs fix bal margin, a sidebar overlay-ként nyílik */
        margin-left: 0;
    }
}

/* ── Topbar addon elemek ──────────────────────────────────── */

.m1-topbar__addon-group {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

/* Kontextuális ikon gomb a topbarban */
.m1-topbar__addon-btn {
    width: 34px;
    height: 34px;
    border-radius: 7px;
    border: 1px solid #e5e7eb;
    background: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #374151;
    font-size: 16px;
    cursor: pointer;
    text-decoration: none;
    position: relative;
    transition: background 0.12s, border-color 0.12s, color 0.12s;
    flex-shrink: 0;
}

.m1-topbar__addon-btn:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
    color: #111111;
    text-decoration: none;
}

/* Badge a számlálóhoz */
.m1-topbar__addon-btn--badge .m1-topbar__badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 10px;
    background: #dc2626;
    color: #ffffff;
    font-size: 10px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    border: 1.5px solid #ffffff;
}

/* Badge mindig látszik (0 esetén is) */

/* Topbar keresőmező (storage oldal) */
.m1-topbar__search {
    display: flex;
    align-items: center;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 7px;
    overflow: hidden;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.m1-topbar__search:focus-within {
    border-color: #f5c842;
    box-shadow: 0 0 0 3px rgba(245, 200, 66, 0.15);
    background: #ffffff;
}

.m1-topbar__search-icon {
    padding: 0 8px 0 10px;
    color: #9ca3af;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
}

.m1-topbar__search-input {
    border: none;
    background: transparent;
    outline: none;
    font-size: 13px;
    color: #111111;
    padding: 6px 10px 6px 0;
    width: 180px;
}

.m1-topbar__search-input::placeholder {
    color: #9ca3af;
}

@media (max-width: 768px) {
    .m1-topbar__search-input {
        width: 120px;
    }
}

/* ── Pagination (globális) ────────────────────────────────── */

.m1-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.m1-pagination__info {
    font-size: 12px;
    color: #6b7280;
    white-space: nowrap;
}

.m1-pagination__btns {
    display: flex;
    align-items: center;
    gap: 4px;
}

.m1-pagination__btn {
    min-width: 34px;
    height: 34px;
    padding: 0 10px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    background: #ffffff;
    color: #374151;
    font-size: 13px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.12s, border-color 0.12s, color 0.12s;
    font-family: inherit;
    font-weight: 400;
}

.m1-pagination__btn:hover:not(:disabled) {
    background: #f3f4f6;
    border-color: #d1d5db;
    color: #111111;
}

.m1-pagination__btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.m1-pagination__btn--active {
    background: #f5c842;
    border-color: #f5c842;
    color: #111111;
    font-weight: 600;
    outline: none;
    box-shadow: none;
}

.m1-pagination__btn--active:hover {
    background: #e6b930 !important;
    border-color: #e6b930 !important;
}

.m1-pagination__btn:focus {
    outline: none;
    box-shadow: none;
}

.m1-pagination__dots {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    color: #9ca3af;
    user-select: none;
}

@media (max-width: 480px) {
    .m1-pagination {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}

/* ── Toast animáció ───────────────────────────────────────── */
@keyframes m1-toast-in {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes m1-toast-out {
    from { opacity: 1; transform: translateY(0); }
    to   { opacity: 0; transform: translateY(16px); }
}