/* ==========================================================================
   Section: Tools Sidebar
   ========================================================================== */

:root {
    --rht-sidebar-width-collapsed: 72px;
    --rht-sidebar-width-expanded: 240px;
    --rht-sidebar-bg: #0a0a0a;
    --rht-sidebar-bg-hover: #171717;
    --rht-sidebar-border: #262626;
    --rht-sidebar-text: #a3a3a3;
    --rht-sidebar-text-hover: #fafafa;
    --rht-sidebar-text-active: #ffffff;
    --rht-sidebar-accent: #6d28d9;
    --rht-sidebar-accent-glow: rgba(109, 40, 217, 0.15);
    --rht-sidebar-transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --rht-sidebar-radius: 10px;
    --rht-whatsapp-green: #25D366;
    --rht-content-bg: #fafafa;
}

.rht-layout {
    display: flex;
    min-height: 100vh;
    background-color: var(--rht-content-bg);
}

.rht-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    width: var(--rht-sidebar-width-collapsed);
    height: 100vh;
    background-color: var(--rht-sidebar-bg);
    border-right: 1px solid var(--rht-sidebar-border);
    transition: width var(--rht-sidebar-transition);
    overflow: hidden;
}

.rht-sidebar:hover {
    width: var(--rht-sidebar-width-expanded);
}

.rht-sidebar__inner {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 20px 0;
}

.rht-content-area {
    flex: 1;
    margin-left: var(--rht-sidebar-width-collapsed);
    min-height: 100vh;
    transition: margin-left var(--rht-sidebar-transition);
    position: relative;
}

/* --- Logo --- */
.rht-sidebar__logo {
    padding: 0 0 24px;
    margin: 0 16px;
    border-bottom: 1px solid var(--rht-sidebar-border);
}

.rht-sidebar__logo-link {
    display: flex;
    align-items: center;
    gap: 12px;
    white-space: nowrap;
    overflow: hidden;
}

.rht-sidebar__logo-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    min-width: 38px;
    background: linear-gradient(135deg, var(--rht-sidebar-accent), #a855f7);
    color: #ffffff;
    font-weight: 700;
    font-size: 14px;
    border-radius: 8px;
}

.rht-sidebar__logo-text {
    font-size: 18px;
    font-weight: 700;
    color: #ffffff;
    opacity: 0;
    transform: translateX(-8px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.rht-sidebar:hover .rht-sidebar__logo-text {
    opacity: 1;
    transform: translateX(0);
    transition-delay: 0.1s;
}

/* --- Navigation --- */
.rht-sidebar__nav {
    flex: 1;
    padding: 16px 0;
    overflow-y: auto;
    overflow-x: hidden;
}

.rht-sidebar__nav-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.rht-sidebar__nav-link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    margin: 0 10px;
    border-radius: var(--rht-sidebar-radius);
    color: var(--rht-sidebar-text);
    white-space: nowrap;
    overflow: hidden;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.rht-sidebar__nav-link:hover {
    background-color: var(--rht-sidebar-bg-hover);
    color: var(--rht-sidebar-text-hover);
}

.rht-sidebar__nav-item--active .rht-sidebar__nav-link {
    background-color: var(--rht-sidebar-accent-glow);
    color: var(--rht-sidebar-text-active);
}

.rht-sidebar__nav-item--active .rht-sidebar__nav-icon {
    color: var(--rht-sidebar-accent);
}

.rht-sidebar__nav-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    min-width: 22px;
    height: 22px;
}

.rht-sidebar__nav-icon svg {
    width: 22px;
    height: 22px;
}

.rht-sidebar__nav-label {
    font-size: 14px;
    font-weight: 500;
    opacity: 0;
    transform: translateX(-8px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.rht-sidebar:hover .rht-sidebar__nav-label {
    opacity: 1;
    transform: translateX(0);
    transition-delay: 0.08s;
}

/* --- Bottom Actions --- */
.rht-sidebar__bottom {
    padding: 16px 0 0;
    margin: 0 10px;
    border-top: 1px solid var(--rht-sidebar-border);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.rht-sidebar__action {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 6px;
    border-radius: var(--rht-sidebar-radius);
    color: var(--rht-sidebar-text);
    white-space: nowrap;
    overflow: hidden;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.rht-sidebar__action:hover {
    background-color: var(--rht-sidebar-bg-hover);
    color: var(--rht-sidebar-text-hover);
}

.rht-sidebar__action--whatsapp:hover {
    color: var(--rht-whatsapp-green);
}

.rht-sidebar__action--whatsapp:hover .rht-sidebar__action-icon {
    color: var(--rht-whatsapp-green);
}

.rht-sidebar__action-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    min-width: 22px;
    height: 22px;
}

.rht-sidebar__action-icon svg {
    width: 22px;
    height: 22px;
}

.rht-sidebar__action-label {
    font-size: 14px;
    font-weight: 500;
    opacity: 0;
    transform: translateX(-8px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.rht-sidebar:hover .rht-sidebar__action-label {
    opacity: 1;
    transform: translateX(0);
    transition-delay: 0.08s;
}

/* --- Mobile Toggle --- */
.rht-sidebar-toggle {
    display: none;
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 1100;
    width: 44px;
    height: 44px;
    padding: 10px;
    background: var(--rht-sidebar-bg);
    border: 1px solid var(--rht-sidebar-border);
    border-radius: 10px;
    cursor: pointer;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
}

.rht-sidebar-toggle__bar {
    display: block;
    width: 20px;
    height: 2px;
    background-color: #ffffff;
    border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.rht-sidebar-toggle--active .rht-sidebar-toggle__bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.rht-sidebar-toggle--active .rht-sidebar-toggle__bar:nth-child(2) {
    opacity: 0;
}

.rht-sidebar-toggle--active .rht-sidebar-toggle__bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* --- Overlay --- */
.rht-sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 999;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.rht-sidebar-overlay--visible {
    display: block;
    opacity: 1;
}

/* --- Responsive --- */
@media screen and (max-width: 768px) {
    .rht-sidebar {
        width: var(--rht-sidebar-width-expanded);
        transform: translateX(-100%);
        transition: transform var(--rht-sidebar-transition);
    }

    .rht-sidebar:hover {
        width: var(--rht-sidebar-width-expanded);
    }

    .rht-sidebar--open {
        transform: translateX(0);
    }

    .rht-sidebar--open .rht-sidebar__logo-text,
    .rht-sidebar--open .rht-sidebar__nav-label,
    .rht-sidebar--open .rht-sidebar__action-label {
        opacity: 1;
        transform: translateX(0);
    }

    .rht-content-area {
        margin-left: 0;
    }

    .rht-sidebar-toggle {
        display: flex;
    }
}

@media screen and (max-width: 480px) {
    .rht-sidebar {
        width: 100%;
    }
}