/**
 * Startapusai Workspace — Fully Autonomous Styles
 */

/* ── RESET & BASE (Isolated) ────────────────────────── */
html {
    margin-top: 0 !important;
}

/* Hide any global theme header/nav on this template */
header, .header, .nav, .site-header {
    display: none !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    visibility: hidden !important;
}

body.page-template-page-workspace {
    padding-top: 0 !important;
    overflow: hidden !important;
    background: #060609 !important;
    margin: 0;
    font-family: 'Inter', sans-serif;
}

.workspace-container {
    display: flex;
    height: 100vh;
    width: 100vw;
}

/* ── SIDEBAR (Standalone Version) ───────────────────── */
.dash-sidebar {
    width: 80px;
    background: #0A0A0F;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 30px 0;
    flex-shrink: 0;
    height: 100vh;
}

.dash-logo {
    margin-bottom: 40px;
    color: #7D56F3;
}

.dash-nav {
    display: flex;
    flex-direction: column;
    gap: 28px;
    align-items: center;
    width: 100%;
    height: 100%;
}

.dash-nav-item {
    color: #62626F;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    transition: 0.3s;
    position: relative;
    width: 100%;
}

.dash-nav-item svg {
    width: 20px;
    height: 20px;
    stroke-width: 2;
}

.dash-nav-item span {
    font-size: 0.52rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.dash-nav-item.active {
    color: #7D56F3;
}

.dash-nav-item.active::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 20px;
    background: #7D56F3;
    box-shadow: 0 0 10px #7D56F3;
    border-radius: 4px 0 0 4px;
}

/* ── MODAL STYLES ──────────────────────────────────── */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: #0A0A0F;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 40px;
    width: 100%;
    max-width: 400px;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    color: #62626F;
    font-size: 1.5rem;
    cursor: pointer;
    transition: 0.3s;
}

.modal-close:hover {
    color: white;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ── CHAT COLUMN ───────────────────────────────────── */
.chat-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    background: #060609;
    position: relative;
}

.chat-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 60px 40px 140px;
}

.chat-inner {
    max-width: 850px;
    margin: 0 auto;
}

/* Message Styles */
.msg-group { margin-bottom: 40px; }
.msg-header {
    font-size: 0.7rem;
    font-weight: 800;
    color: #62626F;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}
.msg-header.user { text-align: right; }

.msg-bubble {
    padding: 24px;
    border-radius: 18px;
    background: #111118;
    border: 1px solid rgba(255, 255, 255, 0.04);
    color: #E4E4E7;
    line-height: 1.7;
    font-size: 1rem;
}

.msg-bubble.user {
    background: #16161F;
    border-color: rgba(125, 86, 243, 0.2);
}

/* ── STICKY INPUT ──────────────────────────────────── */
.chat-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, #060609 80%, transparent);
    padding: 20px 40px 40px;
    z-index: 10;
}

.input-box-wrapper {
    max-width: 800px;
    margin: 0 auto;
    background: #0F0F16;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.4);
}

.input-box-wrapper textarea {
    flex: 1;
    background: transparent;
    border: none;
    color: white;
    font-size: 1rem;
    outline: none;
    resize: none;
}

/* ── ANALYTICS PANEL ───────────────────────────────── */
.analytics-panel {
    width: 360px;
    background: #08080C;
    border-left: 1px solid rgba(255, 255, 255, 0.06);
    height: 100vh;
    padding: 40px 24px;
    display: flex;
    flex-direction: column;
}

.ana-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 12px;
}

.ana-card label {
    display: block;
    font-size: 0.6rem;
    font-weight: 800;
    color: #62626F;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.back-project-card {
    margin-top: auto;
    background: #111118;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    padding: 24px;
}

/* ── RESPONSIVE MOBILE WORKSPACE ────────────────────── */
.workspace-mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: #0A0A0F;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    padding: 0 15px;
    align-items: center;
    justify-content: space-between;
    z-index: 100;
}

.mobile-toggle {
    background: none;
    border: none;
    color: #62626F;
    cursor: pointer;
    padding: 10px;
}

.mobile-toggle svg {
    width: 24px;
    height: 24px;
}

.mobile-logo {
    width: 30px;
}

.drawer-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 150;
}

.drawer-overlay.active {
    display: block;
}

@media (max-width: 768px) {
    .workspace-container {
        height: 100dvh; /* Dynamic viewport height */
    }

    .workspace-mobile-header {
        display: flex;
    }

    .dash-sidebar {
        position: fixed;
        left: -80px;
        top: 0;
        bottom: 0;
        z-index: 200;
        transition: transform 0.3s ease;
    }

    .dash-sidebar.active {
        transform: translateX(80px);
    }

    .analytics-panel {
        position: fixed;
        right: -360px;
        top: 0;
        bottom: 0;
        z-index: 200;
        transition: transform 0.3s ease;
        background: #0A0A0F;
        width: 280px; /* Slimmer on mobile */
    }

    .analytics-panel.active {
        transform: translateX(-360px);
    }

    .chat-col {
        height: 100dvh;
        padding-top: 70px; 
    }

    .chat-scroll {
        padding: 10px 15px 100px; /* Reduced bottom padding */
    }

    .chat-footer {
        padding: 10px 15px 20px;
        background: #060609; /* Solid background to avoid overlap issues */
        position: absolute;
        bottom: 0;
        z-index: 110;
    }

    .msg-bubble {
        padding: 14px;
        font-size: 0.9rem;
    }

    .input-box-wrapper {
        padding: 6px 12px;
        border-radius: 16px;
    }
}
