/**
 * File: calcwood_menu.css
 * Path: calcwood.tomashorsky.com/shared/calcwood_menu.css
 * Info: Styly pro globální navigační menu (Desktop boční panel + Mobilní hamburger).
 * Verze a aktuální datum: 16-04-26 v_1.4
 */

/* ==========================================================================
   CALCWOOD MENU - DESKTOP & MOBILE
   ========================================================================== */

/* --- 1. DESKTOP MENU (Plovoucí panel vlevo) --- */
@media (min-width: 1200px) {
    .th-mobile-menu-wrapper { display: none; } /* Skrýt mobilní menu na PC */

    .th-desktop-menu {
        position: fixed;
        left: 0;
        top: 50%;
        transform: translateY(-50%);
        background: rgba(20, 20, 20, 0.85);
        backdrop-filter: blur(10px);
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-left: none;
        border-radius: 0 16px 16px 0;
        width: 54px; /* Výchozí šířka - jen ikony */
        overflow: hidden;
        transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 9900;
        box-shadow: 5px 5px 20px rgba(0,0,0,0.5);
        padding: 15px 0;
    }

    /* Vysunutí při najetí myší */
    .th-desktop-menu:hover {
        width: 240px;
    }

    .th-d-menu-item {
        display: flex;
        align-items: center;
        padding: 12px 15px;
        color: #ccc;
        text-decoration: none;
        transition: background 0.2s, color 0.2s;
        white-space: nowrap;
    }

    .th-d-menu-item:hover, .th-d-menu-item.active {
        background: rgba(249, 195, 67, 0.1);
        color: #f9c343;
    }

    .th-d-menu-item.active {
        border-left: 3px solid #f9c343;
        padding-left: 12px;
    }

    .th-d-menu-icon {
        width: 24px;
        height: 24px;
        flex-shrink: 0;
        fill: currentColor;
    }

    .th-d-menu-text {
        margin-left: 15px;
        font-size: 14px;
        font-weight: 600;
        opacity: 0;
        transition: opacity 0.3s ease;
        transition-delay: 0s;
    }

    .th-desktop-menu:hover .th-d-menu-text {
        opacity: 1;
        transition-delay: 0.15s; /* Text se objeví až když se panel trochu roztáhne */
    }
}

/* --- 2. MOBILE MENU (Hamburger + Overlay) --- */
@media (max-width: 1199px) {
    .th-desktop-menu { display: none; } /* Skrýt PC menu na mobilu */

    /* Hamburger tlačítko */
    .th-hamburger-btn {
        position: fixed;
        top: 15px;
        right: 15px;
        width: 45px;
        height: 45px;
        background: rgba(20, 20, 20, 0.9);
        backdrop-filter: blur(5px);
        border: 1px solid rgba(255,255,255,0.15);
        border-radius: 50%;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        cursor: pointer;
        z-index: 100001; /* Musí být nad vším */
        box-shadow: 0 4px 10px rgba(0,0,0,0.5);
    }

    .th-hamburger-line {
        width: 20px;
        height: 2px;
        background-color: #f9c343;
        margin: 2px 0;
        transition: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    }

    /* Animace na křížek */
    .th-hamburger-btn.is-active .th-hamburger-line:nth-child(1) {
        transform: translateY(6px) rotate(45deg);
    }
    .th-hamburger-btn.is-active .th-hamburger-line:nth-child(2) {
        opacity: 0;
    }
    .th-hamburger-btn.is-active .th-hamburger-line:nth-child(3) {
        transform: translateY(-6px) rotate(-45deg);
    }

    /* Fullscreen Overlay */
    .th-mobile-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0; /* Lepší než height: 100% kvůli mobilním prohlížečům */
        background: rgba(15, 15, 15, 0.98);
        backdrop-filter: blur(15px);
        z-index: 100000;
        overflow-y: auto; /* Povolení scrollování */
        -webkit-overflow-scrolling: touch; /* Plynulé scrollování na iOS */
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.4s ease;
    }

    .th-mobile-overlay.is-active {
        opacity: 1;
        pointer-events: auto;
    }

    .th-m-menu-nav {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center; /* Vycentruje obsah, pokud je displej velký */
        gap: 25px;
        text-align: center;
        transform: translateY(30px);
        transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        width: 100%;
        min-height: 100%; /* Zaručí, že kontejner má minimálně výšku displeje */
        padding: 80px 0 80px 0; /* Odsazení nahoře i dole (aby šlo dojet až na konec) */
        box-sizing: border-box;
    }

    .th-mobile-overlay.is-active .th-m-menu-nav {
        transform: translateY(0);
    }

    .th-m-menu-item {
        color: #fff;
        text-decoration: none;
        font-size: 22px;
        font-weight: bold;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 15px;
        padding: 10px 20px;
        border-radius: 12px;
        transition: color 0.2s;
    }

    .th-m-menu-item.active {
        color: #f9c343;
        background: rgba(249, 195, 67, 0.1);
    }

    .th-m-menu-icon {
        width: 28px;
        height: 28px;
        fill: currentColor;
    }

    /* Zmenšení hlavního loga a textu na mobilu kvůli hamburger menu */
    .cw-header-logo-img {
        height: 30px !important;
        width: auto !important;
        margin: 0 !important; /* Vynulování původních mezer */
    }
    
    .cw-header-title {
        font-size: 28px !important;
        letter-spacing: 1px !important;
        margin: 0 0 0 10px !important; /* Přesná mezera 10px zleva od pravítka */
        padding: 0 !important;
    }
    
    /* Zajištění, že kontejner loga nesežere místo pro tlačítko menu */
    .cw-header-left {
        display: flex !important;
        align-items: center !important;
        max-width: 70% !important; 
        gap: 0 !important;
        text-decoration: none !important;
    }
}

    /* --- OPRAVA JAZYKŮ V MENU (Smrsknutí šířky a přesun nahoru) --- */
    .th-m-menu-lang-wrapper {
        display: flex;
        justify-content: center;
        width: 100%;
        margin-bottom: 20px; /* Mezera pod jazyky, aby nebyly nalepené na Home */
    }

    .th-mobile-overlay .cw-lang-switcher {
        width: auto !important; /* Zabrání roztažení přes celou obrazovku */
        display: inline-flex !important;
    }

    /* --- TLAČÍTKO DONATE (Káva) --- */
    .th-m-menu-donate {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
        margin: 20px auto 0 auto;
        padding: 12px 25px;
        background: rgba(249, 195, 67, 0.05); /* Velmi jemně žluté pozadí */
        border: 1px solid #f9c343;
        color: #f9c343;
        border-radius: 30px;
        font-size: 14px;
        font-weight: bold;
        text-decoration: none;
        text-transform: uppercase;
        letter-spacing: 1px;
        transition: all 0.3s ease;
    }
    .th-m-menu-donate svg {
        fill: currentColor;
    }
    .th-m-menu-donate:hover {
        background: #f9c343;
        color: #000;
        box-shadow: 0 4px 15px rgba(249, 195, 67, 0.3);
    }

    /* --- PATIČKA MENU (Podmínky a GDPR) --- */
    .th-m-menu-footer {
        margin-top: 40px;
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 12px;
        font-size: 11px;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }
    .th-m-menu-footer a {
        color: #555;
        text-decoration: none;
        transition: color 0.2s;
    }
    .th-m-menu-footer a:hover {
        color: #aaa;
    }
    .th-m-menu-footer .sep {
        color: #333;
    }

    /* --- GLOBÁLNÍ ODKAZY V PATIČCE WEBU (Podmínky a GDPR pro About a Hub) --- */
    .th-global-footer-links {
        font-size: 12px;
        text-align: center;
        margin-bottom: 15px;
    }
    .th-global-footer-links a {
        color: #666;
        text-decoration: none;
        margin: 0 10px;
        transition: color 0.2s;
    }
    .th-global-footer-links a:hover {
        color: #f9c343;
    }
    .th-global-footer-links .th-sep {
        color: #444; /* Tmavě šedá svislá čára, aby nesvítila bíle */
    }

    /* ==========================================================================
   ACCOUNT MODAL (MŮJ ÚČET)
   ========================================================================== */
.th-account-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 999999;
    overflow-y: auto; /* Povolí scrollování celého modálu, pokud je moc velký */
    padding: 20px 10px; /* Bezpečná mezera od okrajů displeje */
    box-sizing: border-box;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.th-account-modal-box {
    background: #161616;
    padding: 40px 30px;
    border-radius: 16px;
    border: 1px solid #333;
    max-width: 420px;
    width: 100%;
    text-align: center;
    color: #fff;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8), inset 0 2px 5px rgba(0, 0, 0, 0.3);
    position: relative;
    box-sizing: border-box;
    transition: max-width 0.3s ease;
    margin: auto; /* Magické vycentrování, které nesežere horní okraj */
}

/* Modifikátor pro široký modál s historií */
.th-account-modal-box.th-modal-wide {
    max-width: 850px;
    width: 100%;
}

/* --- GRID ROZLOŽENÍ MODÁLU --- */
.th-account-layout-grid {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 30px;
    text-align: left;
    align-items: start;
}

.th-account-col-info {
    display: flex;
    flex-direction: column;
}

.th-account-col-history {
    background: #0a0a0a;
    border: 1px solid #2a2a2a;
    border-radius: 12px;
    height: 100%;
    min-height: 300px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* --- STYLY PRO HISTORII --- */
.th-history-header {
    background: #111;
    padding: 15px 20px;
    border-bottom: 1px solid #2a2a2a;
}

.th-history-title {
    color: #888;
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0;
}

/* Styly pro vyhledávání (Lupa) */
.th-history-header-flex { display: flex; justify-content: space-between; align-items: center; }
.th-history-search-box { display: flex; align-items: center; background: rgba(255,255,255,0.05); border-radius: 4px; padding: 4px 8px; }
.th-history-search-input { background: transparent; border: none; color: #fff; font-size: 12px; width: 80px; margin-left: 5px; outline: none; }
.th-history-search-input::placeholder { color: #555; }

.th-history-list {
    flex: none;
    height: 350px;
    overflow-y: auto;
    padding: 10px;
}

/* Scrollbar pro historii */
.th-history-list::-webkit-scrollbar {
    width: 6px;
}
.th-history-list::-webkit-scrollbar-track {
    background: #0a0a0a;
}
.th-history-list::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 10px;
}
.th-history-list::-webkit-scrollbar-thumb:hover {
    background: #f9c343;
}

.th-history-empty {
    text-align: center;
    color: #555;
    font-size: 13px;
    padding: 40px 20px;
    font-style: italic;
}

/* Jednotlivá položka historie */
.th-history-item {
    background: #161616;
    border: 1px solid #2a2a2a;
    border-radius: 8px;
    padding: 12px 15px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.2s ease;
}

.th-history-item:hover {
    border-color: #444;
    background: #1a1a1a;
}

.th-history-item-left {
    flex: 1;
    min-width: 0; /* Pro správné fungování text-overflow */
}

.th-history-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
}

.th-history-date {
    color: #888;
    font-size: 11px;
}

.th-history-type {
    color: #f9c343;
    font-size: 10px;
    font-weight: bold;
    text-transform: uppercase;
    background: rgba(249, 195, 67, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
}

.th-history-note-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.th-history-note {
    color: #fff;
    font-size: 14px;
    font-weight: bold;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Editace poznámky */
.th-history-edit-btn {
    background: none;
    border: none;
    color: #555;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.th-history-edit-btn:hover {
    color: #f9c343;
}

.th-history-edit-btn svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
}

/* Akční tlačítka u položky (Načíst / Smazat) */
.th-history-actions {
    display: flex;
    gap: 8px;
    margin-left: 15px;
}

.th-history-action-btn {
    background: #222;
    border: 1px solid #333;
    color: #aaa;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s;
}

.th-history-action-btn.load:hover {
    background: #f9c343;
    color: #000;
    border-color: #f9c343;
}

.th-history-action-btn.delete:hover {
    background: #ff4444;
    color: #fff;
    border-color: #ff4444;
}

/* --- RESPONZIVITA MODÁLU --- */
@media (max-width: 800px) {
    .th-account-layout-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .th-account-col-history {
        min-height: 250px;
    }
    
    .th-history-list {
        height: 250px;
    }
    
    .th-history-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .th-history-actions {
        margin-left: 0;
        width: 100%;
        justify-content: flex-end;
    }
}

.th-account-modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    cursor: pointer;
    color: #666;
    font-size: 26px;
    font-weight: bold;
    transition: color 0.2s;
    line-height: 1;
}

.th-account-modal-close:hover {
    color: #f9c343;
}

.th-account-modal-title {
    color: #f9c343;
    margin-top: 0;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 22px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.th-account-modal-icon {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.th-account-modal-icon svg {
    width: 100%;
    height: 100%;
    fill: #f9c343;
}

/* Info box pro přihlášené */
.th-account-info-box {
    background: #0a0a0a;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 25px;
    text-align: left;
    border: 1px solid #2a2a2a;
}

.th-account-info-label {
    font-size: 12px;
    color: #888;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.th-account-info-value {
    color: #fff;
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 15px;
    word-break: break-all;
}

.th-account-info-value.highlight {
    color: #f9c343;
}

/* --- TLAČÍTKA V MODÁLU (DECENTNÍ A VEDLE SEBE) --- */
.th-account-actions {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
}

.th-account-btn-manage,
.th-account-btn-logout {
    background: transparent;
    padding: 10px 15px;
    border-radius: 40px;
    font-size: 10px;
    font-weight: bold;
    text-transform: uppercase;
    cursor: pointer;
    flex: 1; /* Roztáhnou se rovnoměrně vedle sebe */
    min-width: 120px; /* Na malém mobilu se zalomí pod sebe */
    text-align: center;
    transition: all 0.3s ease;
    box-sizing: border-box;
    letter-spacing: 0.5px;
}

.th-account-btn-manage {
    border: 1px solid #f9c343;
    color: #f9c343;
}

.th-account-btn-manage:hover {
    background: #f9c343;
    color: #000;
}

.th-account-btn-logout {
    border: 1px solid #444;
    color: #888;
}

.th-account-btn-logout:hover {
    border-color: #fff;
    color: #fff;
}

/* Tlačítko pro připojení (pokud nemá PRO) */
.th-account-btn-primary {
    background: #f9c343;
    color: #000;
    border: none;
    padding: 12px 20px;
    border-radius: 40px;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
    cursor: pointer;
    width: 100%;
    transition: all 0.3s ease;
}
.th-account-btn-primary:hover {
    background: #ffcc4d;
}

.th-account-free-text {
    color: #ccc;
    font-size: 15px;
    margin-bottom: 25px;
    line-height: 1.6;
}
/* Univerzální animace pro všechny modály (Zvětšení ze středu s "pružením") */
@keyframes thModalZoomIn {
    0% {
        opacity: 0;
        transform: scale(0.75);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.th-modal-animate {
    animation: thModalZoomIn 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

/* Input pro editaci poznámky v historii */
.th-history-edit-input {
    width: 100%;
    background: #222;
    color: #fff;
    border: 1px solid #f9c343;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 13px;
    outline: none;
    box-sizing: border-box;
}