/* ==========================================
   Tasklyn Design System - EXACT MATCH
   Background: Periwinkle #e4e7f4
   Cards: Pure white
   Accent: Navy pill + pastel task cards only
   ========================================== */

:root {
    /* === BACKGROUND === */
    --bg-page: #0d1117;
    --bg-color: #0d1117;

    /* === SURFACES === */
    --card-bg: #192438;
    --sidebar-bg: #141d2b;

    /* === BORDERS === */
    --border-color: rgba(255, 255, 255, 0.07);

    /* === TEXT === */
    --text-primary: #e8eaf6;
    --text-secondary: #7b8db0;
    --text-muted: #4e6080;

    /* === NAV ACTIVE PILL (dark navy - color principal #192438) === */
    --nav-active-bg: #192438;
    --nav-active-text: #ffffff;

    /* === PASTEL ACCENT COLORS (used ONLY in task/project cards) === */
    --pastel-blue: rgba(91, 155, 213, 0.18);
    --pastel-peach: rgba(232, 123, 106, 0.18);
    --pastel-lavender: rgba(139, 125, 216, 0.22);
    --pastel-mint: rgba(93, 200, 168, 0.18);

    /* === BRAND ACCENTS (used very sparingly) === */
    --accent-purple: #8b7dd8;
    --accent-coral: #e87b6a;
    --accent-blue: #5b9bd5;
    --accent-green: #5dc8a8;

    /* === DANGER === */
    --danger-color: #f87171;
    --danger-bg: rgba(239, 68, 68, 0.1);

    /* === FONTS === */
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;

    /* === SHADOWS === */
    --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.4), 0 1px 4px rgba(0, 0, 0, 0.2);
    --shadow-hover: 0 8px 30px rgba(0, 0, 0, 0.55);
}

/* === RESET === */
* { box-sizing: border-box; margin: 0; padding: 0; }

/* === BODY === */
body {
    font-family: var(--font-body);
    background-color: var(--bg-page);
    color: var(--text-primary);
    height: 100vh;
    overflow: hidden;
}

/* === APP SHELL === */
.app-wrapper {
    display: flex;
    height: 100vh;
    width: 100vw;
}

/* === SIDEBAR (pure white, no border-right needed, just soft shadow) === */
.nav-sidebar {
    width: 180px;
    background: var(--sidebar-bg);
    border-right: none;
    box-shadow: 2px 0 16px rgba(60, 65, 120, 0.06);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 2rem 0.9rem;
    z-index: 100;
    flex-shrink: 0;
}

.nav-icons-top, .nav-icons-bottom {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    width: 100%;
}

.nav-icon {
    font-size: 0.88rem;
    color: var(--text-secondary);
    cursor: pointer;
    width: 100%;
    height: 40px;
    display: flex;
    align-items: center;
    border-radius: 9999px;
    padding: 0 1rem;
    gap: 0.7rem;
    transition: all 0.18s ease;
    border: none;
    font-weight: 500;
    text-decoration: none;
}

.nav-icon i {
    font-size: 1rem;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.nav-label {
    font-size: 0.83rem;
    font-weight: 500;
    white-space: nowrap;
}

/* Hover: very light gray highlight */
.nav-icon:hover {
    background: rgba(255, 255, 255, 0.07);
    color: var(--text-primary);
}

/* Active: dark navy pill — exactly like Tasklyn */
.nav-icon.active {
    background: var(--nav-active-bg);
    color: var(--nav-active-text);
    box-shadow: 0 4px 14px rgba(28, 25, 66, 0.3);
}

/* === MAIN WORKSPACE === */
.main-workspace {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--bg-page);
}

/* === HEADER === */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.1rem 2rem;
    background: transparent;
    border-bottom: 1px solid var(--border-color);
}

.logo h1 {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* "Chat" span in header gets a subtle color */
.logo span {
    color: #7695c4;
}

/* === LAYOUT CONTAINERS === */
.container {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.tabs-wrapper {
    flex: 1;
    min-width: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

/* === TAB VISIBILITY === */
.tab-content {
    display: none;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.tab-content.active {
    display: flex;
    flex-direction: column;
}

/* === SCROLLBAR === */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(60, 65, 120, 0.15); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(60, 65, 120, 0.25); }

/* === ANIMATIONS === */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* === TOAST === */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: #1e293b;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.9rem 1.4rem;
    border-radius: 18px;
    box-shadow: 0 12px 32px rgba(60, 65, 120, 0.15);
    display: flex;
    align-items: center;
    gap: 0.7rem;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 9999;
}

.toast.show { transform: translateY(0); opacity: 1; }
.toast-success { border-left: 4px solid var(--accent-green); }
.toast-error   { border-left: 4px solid var(--danger-color); }
.toast-info    { border-left: 4px solid var(--accent-purple); }

/* ==========================================
   FOOTER (zona derecha, debajo del tabs-wrapper)
   ========================================== */
.app-footer {
    padding: 0.75rem 2rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    background: transparent;
}

.app-footer p {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.app-footer strong {
    color: var(--text-primary);
    font-weight: 600;
}

.footer-stack {
    font-size: 0.7rem;
    color: var(--text-muted);
    letter-spacing: 0.02em;
}

@keyframes pulse {
  0% { transform: scale(0.8); opacity: 0.5; }
  100% { transform: scale(1.2); opacity: 1; }
}

/* RESPONSIVE DESIGN */
@media (max-width: 900px) {
    .app-wrapper { flex-direction: column; }
    .nav-sidebar {
        width: 100%;
        height: auto;
        flex-direction: row;
        padding: 0.5rem;
        justify-content: center;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }
    .nav-icons-top {
        flex-direction: row;
        justify-content: center;
        margin-top: 0 !important;
        gap: 1rem;
    }
    .nav-icons-bottom { display: none; }
    .nav-icon { width: auto; padding: 0.5rem 1rem; }
    .nav-label { display: none; }
    .container {
        flex-direction: column;
        overflow-y: auto;
    }
    .profile-sidebar {
        width: 100%;
        max-width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        padding: 1rem 1rem 2rem 1rem;
        display: flex;
        flex-direction: column;
        align-items: center;
        overflow: visible;
        height: auto;
    }
    .profile-card, .tech-sheet-card {
        width: 100%;
        max-width: 400px;
        margin-bottom: 0.5rem;
    }
    .tabs-wrapper {
        width: 100%;
        flex: 1 1 auto;
        min-height: 500px;
    }
    header {
        padding: 1rem;
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
    .chat-suggestions {
        flex-wrap: wrap;
        justify-content: center;
    }
    .chat-input-container {
        padding: 0.5rem;
    }
    .message-content {
        max-width: 90%;
    }
}
