/* ==========================================================================
   DROPSITE TOOLBOX STUDIO: SIDEBAR LAYOUT + CYBER-MINIMALIST DECK
   - 2-Column: Sidebar nav (left) + Workspace (right)
   - Grupy narzedzi z wyrazna aktywna selekcja (mint bar po lewej)
   - Glassmorphism dark + frosted backdrop-filter
   ========================================================================== */

.toolbox-clean-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    gap: 32px;
    padding: 20px 20px 80px 20px;
    box-sizing: border-box;
    position: relative;
    z-index: 1;
    max-width: 1200px;
    margin: 0 auto;
}

.toolbox-hero-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    max-width: 820px;
    margin: 0 auto;
    gap: 12px;
    width: 100%;
    animation: tbHeroFadeIn 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes tbHeroFadeIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.toolbox-hero-header .studio-hero-title {
    font-size: clamp(2rem, 4vw, 2.75rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    margin: 0 0 10px 0;
    line-height: 1.15;
}

.toolbox-hero-header .studio-title-gradient {
    background: linear-gradient(135deg, #FFFFFF 30%, #5EEAD4 70%, #38BDF8 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 2px 16px rgba(94, 234, 212, 0.2));
}

.toolbox-hero-header .studio-hero-desc {
    font-size: 15px;
    color: #94A3B8;
    max-width: 680px;
    margin: 0 auto;
    line-height: 1.55;
    font-weight: 450;
}

/* 2-COLUMN SHELL */
.toolbox-cyber-deck {
    position: relative;
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    border-radius: 24px;
    /* Neutralny ciemnoszary glassmorphism o podwyższonej transparentności */
    background: rgba(14, 16, 20, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-top: 1px solid rgba(255, 255, 255, 0.16);
    box-shadow:
        0 24px 60px rgba(0, 0, 0, 0.5),
        0 0 40px rgba(196, 231, 212, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    overflow: hidden;
    box-sizing: border-box;
    display: flex;
    flex-direction: row;
    align-items: stretch;
}

/* SIDEBAR */
.tb-sidebar {
    width: 216px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 20px 0 16px 0;
    /* Ciemniejszy, transparentny neutralny panel */
    background: rgba(10, 11, 14, 0.45);
    border-right: 1px solid rgba(255, 255, 255, 0.07);
    box-sizing: border-box;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    position: relative;
}

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

.tb-sidebar::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 90px;
    /* --accent-glow jako delikatna aura na górze */
    background: linear-gradient(to bottom, rgba(196, 231, 212, 0.07) 0%, transparent 100%);
    pointer-events: none;
    z-index: 0;
}

.tb-sidebar-header {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 18px 14px 18px;
    font-size: 11.5px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    /* --accent-mint z vars.css */
    color: #C4E7D4;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    margin-bottom: 8px;
}

.tb-sidebar-header svg {
    color: #C4E7D4;
    flex-shrink: 0;
    /* --accent-glow */
    filter: drop-shadow(0 0 5px rgba(196, 231, 212, 0.45));
}

.tb-sidebar-group {
    display: flex;
    flex-direction: column;
    gap: 1px;
    padding: 6px 0;
}

.tb-sidebar-group-label {
    display: block;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    /* Nieco jaśniejszy niż poprzednio – lepiej widoczny */
    color: #4A5D7A;
    padding: 0 18px 5px 18px;
}

.tb-sidebar-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 9px 18px 9px 20px;
    background: transparent;
    border: none;
    border-radius: 0;
    color: #94A3B8;
    font-size: 13.5px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: color 0.16s ease, background 0.16s ease;
    text-align: left;
    outline: none;
    user-select: none;
    overflow: hidden;
}

.tb-sidebar-item:hover {
    color: #E2E8F0;
    background: rgba(255, 255, 255, 0.04);
}

.tb-sidebar-item:hover .tb-sidebar-icon {
    /* --accent-mint-dark */
    color: #A8DABF;
}

.tb-sidebar-item.active {
    color: #FFFFFF !important;
    /* --accent-glow jako tło aktywnego – spójne z resztą strony */
    background: linear-gradient(90deg, rgba(196, 231, 212, 0.1) 0%, rgba(196, 231, 212, 0.02) 100%) !important;
}

.tb-sidebar-item.active .tb-sidebar-icon {
    /* --accent-mint */
    color: #C4E7D4 !important;
    filter: drop-shadow(0 0 5px rgba(196, 231, 212, 0.4));
}

.tb-sidebar-item.active .tb-sidebar-label {
    font-weight: 700;
}

.tb-sidebar-active-bar {
    display: none;
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 58%;
    min-height: 16px;
    border-radius: 0 3px 3px 0;
    /* Brand mint gradient – --accent-mint → --accent-mint-dark */
    background: linear-gradient(to bottom, #C4E7D4, #A8DABF);
    box-shadow: 0 0 8px rgba(196, 231, 212, 0.6), 0 0 18px rgba(196, 231, 212, 0.2);
}

.tb-sidebar-item.active .tb-sidebar-active-bar {
    display: block;
    animation: sidebarBarIn 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes sidebarBarIn {
    from { transform: translateY(-50%) scaleY(0); opacity: 0; }
    to   { transform: translateY(-50%) scaleY(1); opacity: 1; }
}

.tb-sidebar-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    /* --text-muted z vars.css */
    color: #5A6A82;
    transition: color 0.16s ease, filter 0.16s ease;
}

.tb-sidebar-label {
    flex: 1;
    line-height: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tb-sidebar-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.055);
    margin: 4px 18px;
}

.tb-sidebar-footer {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 12px 18px 0 18px;
    margin-top: auto;
    font-size: 10.5px;
    /* Bardziej czytelny – --text-muted */
    color: #4A5D7A;
    font-weight: 500;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.tb-sidebar-ram-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #34D399;
    box-shadow: 0 0 8px #34D399;
    flex-shrink: 0;
    animation: deckBeacon 2.5s infinite;
}

/* WORKSPACE */
.tb-workspace {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
}

.deck-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 13px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    /* Neutralny, lekko oddzielony od reszty */
    background: rgba(255, 255, 255, 0.02);
    flex-wrap: wrap;
    gap: 10px;
    flex-shrink: 0;
}

.deck-indicator-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.deck-beacon-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    /* --success-green z vars.css */
    background: #34D399;
    box-shadow: 0 0 8px #34D399, 0 0 16px rgba(52, 211, 153, 0.3);
    animation: deckBeacon 2.5s infinite;
    flex-shrink: 0;
}

@keyframes deckBeacon {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.3); opacity: 0.7; }
}

.deck-tool-label {
    font-size: 14px;
    font-weight: 800;
    color: #F8FAFC;
    letter-spacing: -0.01em;
}

.deck-badge {
    font-size: 10px;
    font-weight: 700;
    /* --accent-mint z vars.css */
    color: #C4E7D4;
    background: rgba(196, 231, 212, 0.08);
    border: 1px solid rgba(196, 231, 212, 0.2);
    padding: 2px 9px;
    border-radius: 999px;
    letter-spacing: 0.025em;
}

.deck-security-note {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: #64748B;
    font-weight: 500;
}

.deck-security-note svg { color: #34D399; }

.toolbox-cockpit-content {
    position: relative;
    width: 100%;
    flex: 1;
    z-index: 2;
    padding: 26px 28px 32px 28px;
    box-sizing: border-box;
}

.tool-panel { position: relative; width: 100%; }

.tool-card-box {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
}

.tool-dropzone {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
    border-radius: 18px;
    border: 1.5px dashed rgba(196, 231, 212, 0.22);
    /* Jaśniejsze – wyraźnie odcina się od ciemnego desku */
    background: rgba(255, 255, 255, 0.065);
    text-align: center;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
}

.tool-dropzone:hover,
.tool-dropzone.drag-over {
    border-color: rgba(196, 231, 212, 0.5);
    background:
        radial-gradient(ellipse 75% 60% at 50% 50%, rgba(52, 211, 153, 0.1) 0%, transparent 70%),
        rgba(255, 255, 255, 0.095);
    box-shadow: 0 0 28px rgba(196, 231, 212, 0.08), inset 0 0 20px rgba(52, 211, 153, 0.04);
    transform: translateY(-2px);
}

/* Przycisk "Wybierz plik" wewnątrz dropzone
   Override globalnego .btn-primary – usuwa ciemną kapsułkę */
.tool-dropzone .btn-primary {
    margin-top: 18px !important;
    background: rgba(255, 255, 255, 0.07) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border: 1px solid rgba(196, 231, 212, 0.3) !important;
    border-top: 1px solid rgba(196, 231, 212, 0.48) !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.12) !important;
    color: #C4E7D4 !important;
    font-size: 13.5px !important;
    font-weight: 700 !important;
    padding: 9px 24px !important;
    border-radius: 12px !important;
    box-shadow: none !important;
    width: auto !important;
}

.tool-drop-icon {
    width: 54px;
    height: 54px;
    border-radius: 16px;
    /* Ikona w brand mint zamiast aqua-blue */
    background: linear-gradient(135deg, rgba(196, 231, 212, 0.12) 0%, rgba(168, 218, 191, 0.07) 100%);
    border: 1px solid rgba(196, 231, 212, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
    color: #C4E7D4;
    box-shadow: 0 0 16px rgba(196, 231, 212, 0.1);
    transition: transform 0.25s ease;
}

.tool-dropzone:hover .tool-drop-icon { transform: scale(1.1); }

.tool-drop-title {
    font-size: 17px;
    font-weight: 800;
    color: #FFFFFF;
    margin-bottom: 6px;
    letter-spacing: -0.015em;
}

.tool-drop-sub {
    font-size: 13px;
    color: #94A3B8;
    max-width: 440px;
    line-height: 1.5;
}

.tool-file-manager {
    /* Neutralny ciemny, bez niebieskiego – równa wartość RGB */
    background: rgba(18, 19, 22, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 16px;
    padding: 14px 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tool-manager-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    font-weight: 700;
    color: #E2E8F0;
}

.badge-count {
    font-size: 10.5px;
    font-weight: 800;
    padding: 2px 9px;
    border-radius: 999px;
    background: rgba(52, 211, 153, 0.12);
    color: #C4E7D4;
    border: 1px solid rgba(52, 211, 153, 0.26);
}

.tool-file-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 240px;
    overflow-y: auto;
}

.tool-empty-placeholder {
    padding: 20px;
    text-align: center;
    color: #64748B;
    font-size: 13px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 10px;
    border: 1px dashed rgba(255, 255, 255, 0.07);
}

.btn-primary.tool-action-btn {
    position: relative;
    width: 100%;
    padding: 14px 28px;
    border-radius: 14px;
    font-size: 14.5px;
    font-weight: 800;
    letter-spacing: -0.01em;
    background: linear-gradient(135deg, #10B981 0%, #34D399 100%);
    color: #090A0F;
    border: 1px solid rgba(255, 255, 255, 0.55);
    cursor: pointer;
    box-shadow: 0 10px 28px rgba(52, 211, 153, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.75);
    transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-primary.tool-action-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 14px 36px rgba(52, 211, 153, 0.44), 0 0 26px rgba(52, 211, 153, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.btn-primary.tool-action-btn:active:not(:disabled) { transform: scale(0.985); }

.btn-primary.tool-action-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    filter: grayscale(0.5);
    box-shadow: none;
}

.tb-ripple-effect {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.45) 0%, rgba(52, 211, 153, 0.2) 60%, transparent 100%);
    transform: scale(0);
    animation: tbRippleAnim 0.55s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    pointer-events: none;
    z-index: 10;
}

@keyframes tbRippleAnim {
    0% { transform: scale(0); opacity: 0.85; }
    100% { transform: scale(3.5); opacity: 0; }
}

.toolbox-trust-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 8px;
    padding: 10px 16px;
    border-radius: 999px;
    background: rgba(14, 20, 36, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.055);
}

.trust-badge-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
    color: #94A3B8;
}

.trust-badge-pill strong { color: #F8FAFC; }

.trust-pill-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}

.trust-pill-dot.dot-mint  { background: #34D399; box-shadow: 0 0 8px #34D399; }
.trust-pill-dot.dot-sky   { background: #38BDF8; box-shadow: 0 0 8px #38BDF8; }
.trust-pill-dot.dot-amber { background: #F59E0B; box-shadow: 0 0 8px #F59E0B; }

/* RESPONSYWNOSC */
@media (max-width: 900px) {
    .tb-sidebar { width: 178px; }
    .tb-sidebar-item { padding: 9px 12px 9px 16px; font-size: 13px; }
    .toolbox-cockpit-content { padding: 20px 18px 28px 18px; }
}

@media (max-width: 680px) {
    .toolbox-cyber-deck { flex-direction: column; border-radius: 20px; }
    .tb-sidebar {
        width: 100%;
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        align-items: center;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        padding: 10px 12px;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.07);
        gap: 6px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .tb-sidebar::-webkit-scrollbar { display: none; }
    .tb-sidebar::before { display: none; }
    .tb-sidebar-header,
    .tb-sidebar-group-label,
    .tb-sidebar-divider,
    .tb-sidebar-footer { display: none !important; }
    .tb-sidebar-group {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        flex: 0 0 auto !important;
        width: auto !important;
        gap: 6px;
        padding: 0;
        margin: 0;
    }
    .tb-sidebar-item {
        display: inline-flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 5px;
        width: auto !important;
        min-width: max-content !important;
        flex: 0 0 auto !important;
        padding: 8px 14px;
        border-radius: 12px;
        font-size: 11.5px;
        white-space: nowrap !important;
        background: rgba(255, 255, 255, 0.04);
        box-sizing: border-box;
    }
    .tb-sidebar-item.active { background: rgba(94, 234, 212, 0.11) !important; }
    .tb-sidebar-active-bar { display: none !important; }
    .tb-sidebar-item.active::after {
        content: '';
        position: absolute;
        bottom: 0;
        left: 15%; right: 15%;
        height: 2px;
        background: #5EEAD4;
        border-radius: 999px;
        box-shadow: 0 0 8px #5EEAD4;
    }
    .tb-sidebar-label {
        display: inline-block !important;
        font-size: 11.5px !important;
        line-height: 1.2 !important;
        white-space: nowrap !important;
        flex: none !important;
        width: auto !important;
        text-align: center;
        letter-spacing: -0.01em;
    }
    .toolbox-clean-wrapper { padding: 14px 10px 60px 10px; gap: 16px; }
    .toolbox-cockpit-content { padding: 18px 16px; }
    .deck-top-bar { padding: 12px 16px; }
    .tool-dropzone { padding: 30px 14px; }
}

@media (max-width: 600px) {
    .toolbox-trust-bar {
        flex-direction: column;
        align-items: flex-start;
        border-radius: 16px;
        gap: 8px;
        padding: 14px 18px;
        width: 100%;
        box-sizing: border-box;
    }
}
