/* ============================================
   Multi-Perspective AI Styles
   ============================================ */

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

:root {
    --purple-dark: #1e0a29;
    --purple-medium: #3b1050;
    --teal: #14b8a6;
    --teal-light: #5eead4;
    --teal-dark: #0d9488;
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --border: #e5e7eb;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --error: #ef4444;
    --success: #10b981;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    line-height: 1.6;
}

/* ============================================
   Header
   ============================================ */

.header {
    background-color: var(--bg-primary);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: opacity 0.2s;
}

.logo:hover {
    opacity: 0.8;
}

.logo-text {
    font-size: 24px;
    font-weight: 500;
    color: var(--purple-dark);
    letter-spacing: -0.5px;
}

.logo-dash {
    color: var(--teal);
    font-weight: 600;
}

.logo-ai {
    color: var(--teal);
}

/* ============================================
   Mobile Menu Button
   ============================================ */

.mobile-menu-btn {
    display: none; /* Hidden on desktop */
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    color: var(--text-primary);
    transition: all 0.2s;
    z-index: 1100;
}

.mobile-menu-btn:hover {
    color: var(--teal);
}

.mobile-menu-btn .close-icon {
    display: none;
}

.mobile-menu-btn.active .hamburger-icon {
    display: none;
}

.mobile-menu-btn.active .close-icon {
    display: block;
}

/* ============================================
   Splash/Login Page
   ============================================ */

.splash-page {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 50%, #f1f5f9 100%);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    overflow-y: auto;
    animation: fadeIn 0.5s ease-out;
}

.splash-page.hidden {
    display: none;
}

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

.splash-container {
    max-width: 1200px;
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.splash-content {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

.splash-logo {
    margin-bottom: 0.5rem;
}

.splash-logo-text {
    font-size: 32px;
}

.splash-title {
    font-size: 3rem;
    font-weight: 700;
    color: var(--purple-dark);
    line-height: 1.2;
    letter-spacing: -1px;
    margin: 0;
}

.splash-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
}

.splash-features {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-top: 0.5rem;
}

.splash-feature {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.splash-feature-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #14b8a6 0%, #0d9488 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 4px 12px rgba(20, 184, 166, 0.2);
}

.splash-feature-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.splash-feature-desc {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.splash-cta {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
}

.splash-login-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, #14b8a6 0%, #0d9488 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1.125rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(20, 184, 166, 0.3);
    width: fit-content;
}

.splash-login-btn:hover {
    background: linear-gradient(135deg, #0d9488 0%, #0f766e 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(20, 184, 166, 0.4);
}

.splash-login-btn:active {
    transform: translateY(0);
}

.splash-login-btn svg {
    transition: transform 0.3s;
}

.splash-login-btn:hover svg {
    transform: translateX(4px);
}

.splash-login-hint {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0;
}

.splash-visual {
    position: relative;
    height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.splash-gradient-orb {
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(20, 184, 166, 0.15) 0%, rgba(30, 10, 41, 0.08) 50%, transparent 70%);
    filter: blur(60px);
    animation: pulse 4s ease-in-out infinite;
    position: relative;
}

.splash-gradient-orb::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(59, 16, 80, 0.12) 0%, transparent 70%);
    filter: blur(40px);
    animation: pulse 3s ease-in-out infinite reverse;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

/* Hide main content when splash is shown */
body.showing-splash .main,
body.showing-splash .header,
body.showing-splash .history-sidebar {
    opacity: 0.3;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

/* Mobile responsive */
@media (max-width: 968px) {
    .splash-container {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .splash-visual {
        height: 300px;
        order: -1;
    }
    
    .splash-gradient-orb {
        width: 300px;
        height: 300px;
    }
    
    .splash-title {
        font-size: 2rem;
    }
    
    .splash-subtitle {
        font-size: 1.125rem;
    }
}

/* ============================================
   Navigation
   ============================================ */

.nav {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-item {
    position: relative;
    cursor: pointer;
    padding: 0.75rem 1rem;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 14px;
    border-radius: 6px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-item:hover {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
}

.nav-item.active {
    color: var(--teal);
    background-color: rgba(20, 184, 166, 0.1);
}

/* ============================================
   Dropdown
   ============================================ */

.dropdown {
    position: relative;
}

.dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Upload zone drag-over highlight (added for better UX) */
.upload-zone {
    border: 2px dashed var(--border);
    background: linear-gradient(180deg, rgba(255,255,255,0.6), rgba(250,250,250,0.6));
    padding: 1.25rem 1rem;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: box-shadow 0.15s ease, transform 0.08s ease, border-color 0.12s ease;
}

.upload-zone .upload-icon {
    width: 36px;
    height: 36px;
    color: var(--text-secondary);
}

.upload-zone.drag-over {
    box-shadow: 0 8px 30px rgba(20, 184, 166, 0.12);
    transform: translateY(-3px);
    border-color: var(--teal-dark);
    background: linear-gradient(180deg, rgba(94,234,212,0.06), rgba(20,184,166,0.03));
}

/* Fallback highlight for textarea when dragging files over it */
.chat-input.drag-over {
    outline: 3px solid rgba(20,184,166,0.12);
    box-shadow: 0 6px 18px rgba(2,6,23,0.04) inset;
}

/* Small accessibility focus state for upload zone */
.upload-zone:focus {
    outline: 3px solid rgba(20,184,166,0.12);
}

/* Visually hidden (screen-reader only) helper */
.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.dropdown-toggle svg {
    width: 16px;
    height: 16px;
    transition: transform 0.2s;
}

.dropdown.open .dropdown-toggle svg {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    min-width: 280px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s;
    z-index: 1001;
    max-height: 70vh;
    overflow-y: auto;
}

.dropdown.open .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.methods-dropdown .dropdown-menu {
    min-width: 450px;
    max-width: 500px;
}

/* Pro Tools Dropdown */
.pro-tools-dropdown .dropdown-menu {
    min-width: 550px;
    max-width: 650px;
}

.pro-tools-tabs {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
    padding: 0;
}

.pro-tools-tab-btn {
    flex: 1;
    padding: 0.625rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.pro-tools-tab-btn:hover {
    background: var(--bg-primary);
    border-color: var(--teal);
    color: var(--text-primary);
}

.pro-tools-tab-btn.active {
    background: var(--teal);
    border-color: var(--teal);
    color: white;
}

.pro-tool-item {
    padding: 0.875rem 1rem;
    margin: 0.5rem;
    background: var(--bg-secondary);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.pro-tool-item:hover {
    background: var(--bg-primary);
    border-color: var(--teal);
    transform: translateX(2px);
}

.pro-tool-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.pro-tool-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
}

.pro-tool-badge {
    padding: 0.25rem 0.625rem;
    background: var(--teal);
    color: white;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
}

.pro-tool-desc {
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.5;
    margin-bottom: 0.5rem;
}

.pro-tool-activation {
    font-size: 12px;
    color: var(--teal-dark);
    font-weight: 500;
    font-style: italic;
}

.pro-tools-coming-soon {
    padding: 2rem 1rem;
    text-align: center;
    color: var(--text-secondary);
}

.pro-tools-coming-icon {
    font-size: 2rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.dropdown-section {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
}

.dropdown-section:last-child {
    border-bottom: none;
}

.dropdown-header {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    letter-spacing: 0.5px;
}

/* Filter Buttons in Dropdown */
.filter-buttons-dropdown {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.filter-btn-small {
    padding: 0.5rem 0.875rem;
    border: 1px solid var(--border);
    background: var(--bg-primary);
    color: var(--text-secondary);
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.filter-btn-small:hover {
    background: var(--bg-secondary);
    border-color: var(--teal-dark);
}

.filter-btn-small.active {
    background: var(--teal);
    border-color: var(--teal);
    color: white;
}

/* Method Items */
.method-item {
    padding: 0.875rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 0.5rem;
    border: 1px solid transparent;
}

.method-item:hover {
    background: var(--bg-secondary);
    border-color: var(--border);
}

.method-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.method-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.method-tag {
    display: inline-block;
    padding: 0.125rem 0.5rem;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-left: 0.5rem;
}

.method-tag.tag-beginner {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
}

.method-tag.tag-intermediate {
    background: rgba(245, 158, 11, 0.1);
    color: #d97706;
}

.method-tag.tag-advanced {
    background: rgba(139, 92, 246, 0.1);
    color: #7c3aed;
}

.method-complexity {
    color: #f59e0b;
    font-size: 14px;
    white-space: nowrap;
}

.method-description {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Regular Dropdown Items */
.dropdown-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.dropdown-item:hover {
    background: var(--bg-secondary);
}

.dropdown-item-icon {
    width: 20px;
    height: 20px;
    color: var(--teal);
    flex-shrink: 0;
    margin-top: 2px;
}

.dropdown-item-content {
    flex: 1;
}

.dropdown-item-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.dropdown-item-desc {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* ============================================
   Account Icon
   ============================================ */

.account-icon-button {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--bg-secondary);
    border: 2px solid var(--border);
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-secondary);
}

.account-icon-button:hover {
    background: var(--teal);
    border-color: var(--teal);
    color: white;
    transform: scale(1.05);
}

.account-dropdown .dropdown-menu {
    right: 0;
    left: auto;
}

/* ============================================
   History Sidebar
   ============================================ */

.history-sidebar {
    position: fixed;
    right: 0;
    top: 70px;
    width: 350px;
    height: calc(100vh - 70px);
    background: var(--bg-primary);
    border-left: 1px solid var(--border);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 999;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.history-sidebar.open {
    transform: translateX(0);
}

.history-sidebar.pinned {
    transform: translateX(0);
    position: fixed;
}

.history-sidebar.pinned:not(.open) {
    transform: translateX(100%);
}

.main.history-pinned {
    margin-right: 350px;
    transition: margin-right 0.3s ease;
}

.history-header {
    padding: 1.5rem 1.25rem;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.history-header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.history-header-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.history-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.history-close,
.history-pin,
.history-refresh {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
}

.history-pin .pin-emoji {
    font-size: 18px;
    transition: all 0.2s;
    /* Default: black/gray appearance */
    filter: grayscale(100%) brightness(0.3);
}

.history-refresh {
    color: #10b981;
}

.history-refresh:hover {
    background: #dcfce7;
    color: #059669;
}

.history-refresh:active {
    transform: rotate(180deg);
}

.history-close:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.history-pin:hover {
    background: var(--bg-secondary);
}

.history-pin:hover:not(.active) .pin-emoji {
    transform: scale(1.1);
    filter: grayscale(100%) brightness(0.4);
}

.history-pin.active .pin-emoji {
    /* Pinned state: teal color and rotated to look like it's pushed in */
    filter: grayscale(0%) hue-rotate(135deg) saturate(1.8) brightness(1.1);
    transform: rotate(-15deg) translateY(2px);
}

.history-search {
    position: relative;
    margin-bottom: 1rem;
}

.history-search input {
    width: 100%;
    padding: 0.625rem 0.875rem 0.625rem 2.5rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s;
}

.history-search input:focus {
    outline: none;
    border-color: var(--teal);
    box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.1);
}

.history-search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--text-secondary);
}

.history-filters {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding-bottom: 0.25rem;
}

.history-filter-btn {
    padding: 0.5rem 0.875rem;
    border: 1px solid var(--border);
    background: var(--bg-primary);
    color: var(--text-secondary);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
    flex-shrink: 0;
}

.history-filter-btn:hover {
    background: var(--bg-secondary);
    border-color: var(--teal-dark);
}

.history-filter-btn.active {
    background: var(--teal);
    border-color: var(--teal);
    color: white;
}

.history-content {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.history-group {
    margin-bottom: 1.5rem;
}

.history-group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.5rem;
}

.history-group-title {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
}

.history-item {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.875rem;
    margin-bottom: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.history-item:hover {
    border-color: var(--teal);
    box-shadow: 0 2px 8px rgba(20, 184, 166, 0.15);
    transform: translateY(-1px);
    background: var(--bg-secondary);
}

.history-item.active {
    border-color: var(--teal);
    background: linear-gradient(135deg, rgba(20, 184, 166, 0.08) 0%, rgba(20, 184, 166, 0.04) 100%);
    box-shadow: 0 2px 8px rgba(20, 184, 166, 0.2);
}

.history-item.active .history-item-title {
    color: var(--teal-dark);
}

.history-item-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.history-item-preview {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 0.625rem;
}

.history-item-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-secondary);
}

/* ============================================
   Main Content
   ============================================ */

.main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    transition: padding-left 0.3s ease;
}

.main.with-history {
    padding-left: 370px;
}

.chat-container {
    background: var(--bg-primary);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    height: calc(100vh - 140px);
    overflow: hidden;
}

.chat-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border);
}

.chat-header h2 {
    font-size: 20px;
    font-weight: 600;
    color: var(--purple-dark);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.message {
    max-width: 75%;
    padding: 1rem 1.25rem;
    border-radius: 12px;
    word-wrap: break-word;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message.user {
    align-self: flex-end;
    background: linear-gradient(135deg, var(--teal) 0%, var(--teal-dark) 100%);
    color: white;
    border-bottom-right-radius: 4px;
}

.message.assistant {
    align-self: flex-start;
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-bottom-left-radius: 4px;
}

/* Formatted content within messages */
.message p {
    margin: 0 0 0.75rem 0;
    line-height: 1.6;
}

.message p:last-child {
    margin-bottom: 0;
}

.message ul,
.message ol {
    margin: 0.5rem 0 0.75rem 0;
    padding-left: 1.5rem;
    line-height: 1.6;
}

.message li {
    margin-bottom: 0.375rem;
}

.message li:last-child {
    margin-bottom: 0;
}

.message h1,
.message h2,
.message h3 {
    margin: 1rem 0 0.5rem 0;
    font-weight: 600;
    line-height: 1.4;
}

.message h1:first-child,
.message h2:first-child,
.message h3:first-child {
    margin-top: 0;
}

.message h1 {
    font-size: 1.5rem;
}

.message h2 {
    font-size: 1.25rem;
}

.message h3 {
    font-size: 1.1rem;
}

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

.message code {
    background: rgba(0, 0, 0, 0.05);
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
    font-size: 0.9em;
    font-family: 'Monaco', 'Courier New', monospace;
}

.message pre {
    background: rgba(0, 0, 0, 0.05);
    padding: 0.75rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 0.5rem 0 0.75rem 0;
}

.message pre code {
    background: none;
    padding: 0;
    font-size: 0.875rem;
    line-height: 1.5;
}

.message blockquote {
    border-left: 3px solid var(--teal);
    padding-left: 1rem;
    margin: 0.5rem 0 0.75rem 0;
    color: var(--text-secondary);
    font-style: italic;
}

/* ============================================
   Chat Input Area
   ============================================ */

.chat-input-area {
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--border);
    background: var(--bg-primary);
}

.upload-zone {
    border: 2px dashed var(--border);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 1rem;
    display: none;
}

.upload-zone.active {
    display: block;
}

.upload-zone:hover {
    border-color: var(--teal);
    background: rgba(20, 184, 166, 0.05);
}

.upload-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 1rem;
    color: var(--text-secondary);
}

.upload-text {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.upload-hint {
    font-size: 13px;
    color: var(--text-secondary);
}

.input-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* File attachment badge */
.file-attachment-badge {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, #f0fdfa 0%, #ccfbf1 100%);
    border: 1px solid var(--teal);
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.25rem;
}

.file-attachment-badge.hidden {
    display: none;
}

.file-attachment-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    color: var(--teal-dark);
}

.file-attachment-name {
    font-weight: 500;
    font-size: 14px;
    color: var(--text-primary);
}

.file-attachment-size {
    font-size: 12px;
    color: var(--text-secondary);
}

.file-attachment-remove {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

.file-attachment-remove:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
}

.input-wrapper-container {
    display: flex;
    gap: 0.75rem;
    align-items: flex-end;
}

.input-wrapper {
    flex: 1;
    position: relative;
}

.chat-input {
    width: 100%;
    padding: 0.875rem 3rem 0.875rem 1rem;
    border: 2px solid var(--border);
    border-radius: 12px;
    font-size: 15px;
    font-family: inherit;
    resize: none;
    transition: all 0.2s;
    min-height: 48px;
    max-height: 120px;
}

.chat-input:focus {
    outline: none;
    border-color: var(--teal);
}

.upload-button {
    position: absolute;
    right: 0.75rem;
    bottom: 0.75rem;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
    border-radius: 6px;
}

.upload-button:hover {
    color: var(--teal);
    background: var(--bg-secondary);
}

.download-button {
    padding: 0.875rem;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: #1f2937;
    border: none;
    border-radius: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.download-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(251, 191, 36, 0.3);
}

.download-button:active {
    transform: translateY(0);
}

.send-button {
    padding: 0.875rem 1.5rem;
    background: linear-gradient(135deg, var(--teal) 0%, var(--teal-dark) 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.send-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(20, 184, 166, 0.3);
}

.send-button:active {
    transform: translateY(0);
}

.send-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ============================================
   Loading Animation
   ============================================ */

.loading {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.loading-dot {
    width: 8px;
    height: 8px;
    background: var(--teal);
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
}

.loading-dot:nth-child(1) { animation-delay: -0.32s; }
.loading-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* ============================================
   Scrollbar
   ============================================ */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* ============================================
   Mobile Responsive
   ============================================ */

@media (max-width: 768px) {
    /* Show mobile menu button */
    .mobile-menu-btn {
        display: block;
    }

    /* Hide navigation by default on mobile */
    .nav {
        display: none;
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        bottom: 0;
        background: var(--bg-primary);
        flex-direction: column;
        padding: 1rem;
        overflow-y: auto;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        z-index: 1050;
        animation: slideDown 0.3s ease-out;
    }

    /* Show navigation when menu is open */
    .nav.mobile-open {
        display: flex;
    }

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

    /* Stack nav items vertically */
    .nav .dropdown,
    .nav .nav-item {
        width: 100%;
        border-bottom: none; /* Remove borders for tighter spacing */
    }

    .nav .nav-item {
        padding: 0.5rem 1rem; /* Compact padding */
        justify-content: flex-start;
        margin-bottom: 0; /* Remove any margin */
    }

    .nav .dropdown {
        padding: 0; /* Remove extra padding from dropdown containers */
        margin-bottom: 0; /* Remove margin between dropdowns */
    }

    .nav .dropdown-toggle {
        padding: 0.5rem 1rem; /* Match nav-item padding */
        margin-bottom: 0; /* No margin */
    }

    /* Mobile dropdown adjustments */
    .nav .dropdown-menu {
        display: none; /* Hidden by default - no space taken */
        position: static;
        box-shadow: none;
        border: none;
        border-left: 3px solid var(--teal);
        margin-left: 1rem;
        margin-top: 0.25rem;
        margin-bottom: 0.25rem;
        max-height: none;
    }

    /* Only show dropdown menu when open/active */
    .nav .dropdown.open .dropdown-menu,
    .nav .dropdown.active .dropdown-menu {
        display: block;
    }

    .main {
        padding: 1rem;
    }

    .main.with-history {
        padding-right: 1rem;
    }

    .history-sidebar {
        width: 100%;
        max-width: 280px; /* Wider for better readability since it's temporary */
    }

    /* On mobile, history always overlays - never pinned */
    .main.history-pinned {
        margin-right: 0; /* Don't push content on mobile */
    }

    /* Always show shadow on mobile when history is open */
    .history-sidebar.open,
    .history-sidebar.pinned {
        box-shadow: -4px 0 12px rgba(0, 0, 0, 0.3);
    }

    /* Disable pinning on mobile - always acts as overlay */
    .history-sidebar.pinned {
        position: fixed; /* Always fixed, never pushes content */
    }

    /* Hide pin button on mobile - not needed */
    .history-pin {
        display: none;
    }

    /* Reduce history padding on mobile */
    .history-header {
        padding: 1rem;
    }

    .history-content {
        padding: 0.5rem;
    }

    /* Auto-close history when selecting a conversation on mobile */
    .history-item {
        cursor: pointer;
    }

    .chat-container {
        height: calc(100vh - 100px);
    }

    .message {
        max-width: 85%;
    }

    .chat-header h2 {
        font-size: 18px;
    }

    .chat-messages {
        padding: 1rem;
    }

    .chat-input-area {
        padding: 1rem;
    }

    .methods-dropdown .dropdown-menu {
        min-width: auto;
        width: 100%;
    }

    .pro-tools-dropdown .dropdown-menu {
        min-width: auto;
        width: 100%;
    }
}

@media (max-width: 480px) {
    .header-content {
        height: 60px;
        padding: 0 1rem;
    }

    .logo-text {
        font-size: 20px;
    }

    .message {
        max-width: 90%;
        padding: 0.875rem 1rem;
        font-size: 14px;
    }

    .chat-input {
        font-size: 16px; /* Prevents iOS zoom */
    }
   
}
 /* History Item Action Buttons */
 .history-item-actions {
    margin-top: 8px;
    display: flex;
    gap: 6px;
    justify-content: flex-end;
  }
  
  .btn-small {
    font-size: 12px;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
    color: white;
  }
  
  .btn-small[data-action="resume"] {
    background: #14b8a6; /* teal */
  }
  .btn-small[data-action="resume"]:hover {
    background: #0d9488;
  }
  
  .btn-small[data-action="share"] {
    background: #fbbf24; /* amber */
    color: #1f2937;
  }
  .btn-small[data-action="share"]:hover {
    background: #f59e0b;
  }
  
  .btn-small[data-action="delete"] {
    background: #ef4444; /* red */
  }
  .btn-small[data-action="delete"]:hover {
    background: #dc2626;
  }
  .history-item {
    transition: opacity 0.3s ease, transform 0.3s ease;
  }
  .history-item.removed {
    opacity: 0;
    transform: translateX(10px);
  }
  .history-filter-btn.active {
    background: #14b8a6;
    color: white;
    border-radius: 6px;
  }
  .history-item.new {
    animation: flashNew 0.4s ease-in-out;
  }
  @keyframes flashNew {
    0% { background: #d1fae5; }
    100% { background: transparent; }
  }
  /* -------------------------
   HISTORY ITEM BUTTONS
-------------------------- */
.history-item-actions {
    margin-top: 8px;
    display: flex;
    gap: 8px;
    justify-content: flex-start;
  }
  
  .btn-small {
    font-size: 12px;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
    color: white;
  }
  
  /* Resume */
  .btn-small[data-action="resume"] {
    background: #14b8a6;
  }
  .btn-small[data-action="resume"]:hover {
    background: #0d9488;
  }

  /* Download - Yellow */
  .btn-small[data-action="download"] {
    background: #fbbf24;
    color: #1f2937;
  }
  .btn-small[data-action="download"]:hover {
    background: #f59e0b;
  }

  /* Share - Green */
  .btn-small[data-action="share"] {
    background: #10b981;
    color: white;
  }
  .btn-small[data-action="share"]:hover {
    background: #059669;
  }

  /* Delete - Red */
  .btn-small[data-action="delete"] {
    background: #ef4444;
  }
  .btn-small[data-action="delete"]:hover {
    background: #dc2626;
  }
  
  /* Fade animation for removed cards */
  .history-item {
    transition: opacity 0.3s ease, transform 0.3s ease;
  }
  .history-item.removed {
    opacity: 0;
    transform: translateX(10px);
  }
  /* ============================================
   HISTORY TAG COLOR MAPPING (based on methods)
   ============================================ */

.history-item-tag {
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border);
  }
  
  /* Beginner Tags */
  .history-item-tag[data-type="QUICK"],
  .history-item-tag[data-type="STAKEHOLDER"],
  .history-item-tag[data-type="NOTES SUMMARY"],
  .history-item-tag[data-type="CONFLICT"] {
    background: #ecfdf5;
    color: #047857;
    border-color: #a7f3d0;
  }
  
  /* Intermediate Tags */
  .history-item-tag[data-type="PATTERN"],
  .history-item-tag[data-type="SCENARIO TEST"],
  .history-item-tag[data-type="TIME HORIZON"] {
    background: #fffbeb;
    color: #92400e;
    border-color: #fde68a;
  }
  
  /* Advanced Tags */
  .history-item-tag[data-type="FULL"],
  .history-item-tag[data-type="SYNTHESIS"],
  .history-item-tag[data-type="SYNTHESIS (ALL)"],
  .history-item-tag[data-type="INNER PEACE SYNTHESIS"],
  .history-item-tag[data-type="COACHING PLAN"],
  .history-item-tag[data-type="SKILLS"],
  .history-item-tag[data-type="HUMAN HARM CHECK"] {
    background: #f3e8ff;
    color: #6d28d9;
    border-color: #ddd6fe;
  }
  
/* Add class-based styles for history buttons to ensure robustness */
.btn-small.btn-resume { background: #14b8a6; }
.btn-small.btn-resume:hover { background: #0d9488; }

.btn-small.btn-download { background: #fbbf24; color: #1f2937; }
.btn-small.btn-download:hover { background: #f59e0b; }

.btn-small.btn-share { background: #10b981; color: white; }
.btn-small.btn-share:hover { background: #059669; }

.btn-small.btn-delete { background: #ef4444; }
.btn-small.btn-delete:hover { background: #dc2626; }

/* Disabled state styling for history buttons */
.btn-small:disabled { opacity: 1; filter: none; cursor: not-allowed; }

.btn-small.btn-resume:disabled { background: #93e2d8; color: #ffffff; }
.btn-small.btn-download:disabled { background: #fde68a; color: #1f2937; }
.btn-small.btn-share:disabled { background: #86efac; color: #ffffff; }
.btn-small.btn-delete:disabled { background: #fca5a5; color: #ffffff; }

/* Attribute-based variants as fallback */
.btn-small[disabled][data-action="resume"] { background: #93e2d8; color: #ffffff; }
.btn-small[disabled][data-action="download"] { background: #fde68a; color: #1f2937; }
.btn-small[disabled][data-action="share"] { background: #86efac; color: #ffffff; }
.btn-small[disabled][data-action="delete"] { background: #fca5a5; color: #ffffff; }

/* Stronger specificity to ensure disabled buttons keep color */
.history-item-actions button.btn-small.btn-resume:disabled { background: #14b8a6 !important; color: #ffffff !important; opacity: 1 !important; }
.history-item-actions button.btn-small.btn-download:disabled { background: #fbbf24 !important; color: #1f2937 !important; opacity: 1 !important; }
.history-item-actions button.btn-small.btn-share:disabled { background: #10b981 !important; color: #ffffff !important; opacity: 1 !important; }
.history-item-actions button.btn-small.btn-delete:disabled { background: #ef4444 !important; color: #ffffff !important; opacity: 1 !important; }

/* Fallback: color history buttons by order if classes/attributes are missing (Download, Share, Delete) */
.history-item-actions .btn-small:nth-child(1) { background: #fbbf24; color: #1f2937; }
.history-item-actions .btn-small:nth-child(1):hover { background: #f59e0b; }

.history-item-actions .btn-small:nth-child(2) { background: #10b981; color: #ffffff; }
.history-item-actions .btn-small:nth-child(2):hover { background: #059669; }

.history-item-actions .btn-small:nth-child(3) { background: #ef4444; color: #ffffff; }
.history-item-actions .btn-small:nth-child(3):hover { background: #dc2626; }
  
  