/* ── RESET DEL LAYOUT ── */
body {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

/* ── SIDEBAR ── */
.ek-topbar {
    padding: 0.75rem 1.5rem;
    border-bottom: 1px solid rgba(139, 92, 246, 0.2);
    background: #0a0a0a;
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ek-topbar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.ek-topbar-icon {
    color: rgba(255, 255, 255, 0.5);
    font-size: 1.2rem;
    text-decoration: none;
    transition: color 0.2s;
}

.ek-topbar-icon:hover {
    color: white;
}

.ek-topbar-login {
    background: rgba(139, 92, 246, 0.15);
    border: 1px solid rgba(139, 92, 246, 0.4);
    color: rgba(255, 255, 255, 0.8);
    padding: 0.3rem 0.9rem;
    border-radius: 20px;
    font-size: 0.85rem;
    text-decoration: none;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.ek-topbar-login:hover {
    background: rgba(139, 92, 246, 0.3);
    color: white;
}

.ek-sidebar {
    width: 260px;
    background: rgba(10, 10, 10, 0.97);
    border-right: 1px solid rgba(139, 92, 246, 0.2);
    display: flex;
    flex-direction: column;
    padding: 1.5rem 1rem;
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    z-index: 100;
    transition: width 0.3s ease, opacity 0.3s ease, padding 0.3s ease;
    box-sizing: border-box;
}

.ek-sidebar.collapsed {
    width: 0;
    padding: 0;
    overflow: hidden;
    border: none;
    opacity: 0;
    pointer-events: none;
}

/* ── SIDEBAR HEADER ── */
.ek-sidebar-header {
    display: flex;
    align-items: center;
    padding-bottom: 1.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid rgba(139, 92, 246, 0.2);
}

.ek-sidebar-logo-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ek-sidebar-logo {
    width: 32px;
    height: 32px;
}

.ek-sidebar-brand {
    font-size: 1.1rem;
    font-weight: 700;
    color: white;
    white-space: nowrap;
}

/* ── SIDEBAR NAV ── */
.ek-sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
}

.ek-sidebar-btn {
    background: transparent;
    border: none;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
    text-align: left;
    font-size: 1rem;
    text-decoration: none;
    white-space: nowrap;
}

.ek-sidebar-btn i {
    width: 24px;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.ek-sidebar-btn:hover,
.ek-sidebar-btn.active {
    background: rgba(139, 92, 246, 0.15);
    color: white;
}

.ek-sidebar-btn.active {
    border-left: 3px solid #8b5cf6;
}

/* ── SIDEBAR FOOTER (language) ── */
.ek-sidebar-footer {
    padding-top: 1.5rem;
    border-top: 1px solid rgba(139, 92, 246, 0.2);
    margin-top: 1rem;
}

.ek-lang-selector {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

.ek-lang-selector a {
    color: rgba(255, 255, 255, 0.5);
    text-decoration: none;
    font-size: 0.85rem;
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    transition: all 0.2s;
}

.ek-lang-selector a:hover,
.ek-lang-selector a.active {
    background: rgba(139, 92, 246, 0.3);
    color: white;
}

/* ── TOGGLE BUTTON ── */
.ek-sidebar-toggle {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.3rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ek-sidebar-toggle:hover {
    background: rgba(139, 92, 246, 0.2);
    color: white;
}

.ek-sidebar-close {
    display: none;
    background: transparent;
    border: none;
    color: rgba(255,255,255,0.6);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.3rem;
    margin-left: 4rem;
}

@media (max-width: 768px) {
    .ek-sidebar-close {
        display: block;
    }
}

/* ── MAIN CONTENT ── */
.ek-main {
    margin-left: 260px;
    min-height: 100vh;
    transition: margin-left 0.3s ease;
}

/* ── MOBILE ── */
@media (max-width: 768px) {
    .ek-main {
        margin-left: 0 !important;
        min-height: 100vh;
        height: 100vh;
        overflow-y: auto;
    }

    .ek-sidebar:not(.collapsed) {
        z-index: 150;
        width: 260px;
    }
}

.ek-footer {
    margin-left: 260px;
    padding: 1.5rem 2rem;
    border-top: 1px solid rgba(139, 92, 246, 0.2);
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.85rem;
    background: #0a0a0a;
    transition: margin-left 0.3s ease;
}

.ek-footer-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ek-footer-right {
    display: flex;
    gap: 1rem;
}

.ek-footer-right a {
    color: rgba(255, 255, 255, 0.4);
    font-size: 1.1rem;
    transition: color 0.2s;
    text-decoration: none;
}

.ek-footer-right a:hover {
    color: white;
}

.chat-sidebar.collapsed ~ * .ek-footer,
.chat-sidebar.collapsed ~ .ek-footer {
    margin-left: 0;
}

@media (max-width: 768px) {
    .ek-footer {
        margin-left: 0 !important;
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
}