/* ==========================================================================
   Zygn AI Assistant - Pinterest Dark Theme
   ========================================================================== */

:root {
    --bg-main: #07080a;
    --bg-surface: #0e1015;
    --bg-card: rgba(18, 21, 28, 0.85);
    --bg-card-hover: rgba(25, 30, 40, 0.95);
    --border-subtle: rgba(255, 255, 255, 0.07);
    --border-hover: rgba(0, 220, 255, 0.35);

    /* Zygn Brand Accent Colors */
    --zygn-teal: #3C7F72;
    --zygn-teal-glow: rgba(60, 127, 114, 0.3);
    --zygn-coral: #D34A24;
    --zygn-coral-glow: rgba(211, 74, 36, 0.3);
    --zygn-rust: #992800;
    --zygn-rust-glow: rgba(153, 40, 0, 0.3);
    --zygn-amber: #FFAF00;
    --zygn-amber-glow: rgba(255, 175, 0, 0.3);
    
    /* Neon AI Core Colors */
    --neon-cyan: #00e5ff;
    --neon-blue: #0077ff;

    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;

    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-full: 9999px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    background-image: 
        radial-gradient(circle at 50% 0%, rgba(0, 180, 255, 0.07) 0%, transparent 50%),
        radial-gradient(circle at 85% 30%, rgba(255, 175, 0, 0.03) 0%, transparent 40%),
        radial-gradient(circle at 15% 40%, rgba(60, 127, 114, 0.03) 0%, transparent 40%);
}

.app-layout {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

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

.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 28px;
    background: rgba(11, 13, 18, 0.85);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid var(--border-subtle);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.brand-logo {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    object-fit: cover;
    filter: drop-shadow(0 0 10px rgba(0, 200, 255, 0.4));
    transition: transform 0.3s ease;
}

.brand-logo:hover {
    transform: scale(1.06) rotate(2deg);
}

.brand-text h1 {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.assistant-tag {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--neon-cyan), var(--neon-blue));
    color: #000;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.brand-sub {
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 8px #10b981;
    animation: pulse 2s infinite ease-in-out;
}

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

.btn-new-chat {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-new-chat:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

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

.main-container {
    flex: 1;
    max-width: 1040px;
    width: 100%;
    margin: 0 auto;
    padding: 24px 20px 180px 20px;
    display: flex;
    flex-direction: column;
}

/* ==========================================================================
   Pinterest Inspiration Board (Pins Grid)
   ========================================================================== */

.pinterest-board {
    margin-bottom: 24px;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.pinterest-board.hidden {
    display: none;
}

.board-header {
    text-align: center;
    margin-bottom: 28px;
}

.board-header h2 {
    font-size: 1.7rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 6px;
    background: linear-gradient(135deg, #fff 40%, var(--neon-cyan) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.board-header p {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.pins-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 18px;
}

.pin-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 22px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(12px);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
}

.pin-card:hover {
    background: var(--bg-card-hover);
    transform: translateY(-5px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.5);
}

.pin-card.teal-accent:hover { border-color: var(--zygn-teal); box-shadow: 0 10px 25px var(--zygn-teal-glow); }
.pin-card.coral-accent:hover { border-color: var(--zygn-coral); box-shadow: 0 10px 25px var(--zygn-coral-glow); }
.pin-card.amber-accent:hover { border-color: var(--zygn-amber); box-shadow: 0 10px 25px var(--zygn-amber-glow); }
.pin-card.rust-accent:hover { border-color: var(--zygn-rust); box-shadow: 0 10px 25px var(--zygn-rust-glow); }

.pin-tag {
    align-self: flex-start;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 14px;
}

.teal-accent .pin-tag { background: rgba(60, 127, 114, 0.25); color: #6ee7b7; border: 1px solid rgba(60, 127, 114, 0.5); }
.coral-accent .pin-tag { background: rgba(211, 74, 36, 0.25); color: #fca5a5; border: 1px solid rgba(211, 74, 36, 0.5); }
.amber-accent .pin-tag { background: rgba(255, 175, 0, 0.25); color: #fde047; border: 1px solid rgba(255, 175, 0, 0.5); }
.rust-accent .pin-tag { background: rgba(153, 40, 0, 0.25); color: #fdba74; border: 1px solid rgba(153, 40, 0, 0.5); }

.pin-icon {
    font-size: 1.8rem;
    margin-bottom: 12px;
}

.pin-card h3 {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: #fff;
}

.pin-card p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.45;
    flex: 1;
    margin-bottom: 16px;
}

.pin-action {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--neon-cyan);
    opacity: 0.85;
    transition: gap 0.2s ease, opacity 0.2s ease;
}

.pin-card:hover .pin-action {
    opacity: 1;
    gap: 10px;
}

/* ==========================================================================
   Chat Feed & Message Pin Cards
   ========================================================================== */

.chat-feed {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
}

/* User Bubble & Actions */
.user-row {
    display: flex;
    justify-content: flex-end;
    width: 100%;
}

.user-bubble-container {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    max-width: 75%;
    gap: 6px;
}

.user-bubble {
    width: 100%;
    padding: 14px 20px;
    background: linear-gradient(135deg, #182333 0%, #1e2c40 100%);
    border: 1px solid rgba(0, 180, 255, 0.3);
    border-radius: var(--radius-lg) var(--radius-lg) var(--radius-sm) var(--radius-lg);
    color: #ffffff;
    font-size: 0.95rem;
    line-height: 1.5;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    word-break: break-word;
    white-space: pre-wrap;
}

.user-message-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    opacity: 0;
    transition: opacity 0.2s ease;
    padding-right: 4px;
}

.user-row:hover .user-message-actions {
    opacity: 1;
}

@media (hover: none) {
    .user-message-actions {
        opacity: 0.85;
    }
}

.user-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.user-action-btn:hover {
    background: rgba(255, 255, 255, 0.14);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.3);
}

/* Inline User Edit Box (Matching screenshot representation) */
.user-edit-box {
    width: 100%;
    background: #1e2633;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: var(--radius-lg);
    padding: 14px 18px 12px 18px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.2s ease;
}

.user-edit-textarea {
    width: 100%;
    min-height: 54px;
    max-height: 220px;
    background: transparent;
    border: none;
    outline: none;
    color: #ffffff;
    font-family: inherit;
    font-size: 0.95rem;
    line-height: 1.55;
    resize: none;
    padding: 0;
    margin: 0;
    overflow-y: auto;
}

.user-edit-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 10px;
}

.btn-edit-cancel {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-full);
    color: #e2e8f0;
    font-size: 0.82rem;
    font-weight: 500;
    padding: 6px 16px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-edit-cancel:hover {
    background: rgba(255, 255, 255, 0.16);
    color: #ffffff;
}

.btn-edit-send {
    background: #ffffff;
    border: none;
    border-radius: var(--radius-full);
    color: #000000;
    font-size: 0.82rem;
    font-weight: 600;
    padding: 6px 18px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-edit-send:hover {
    background: #e2e8f0;
    transform: scale(1.02);
}

/* AI Pin Card */
.ai-pin-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 24px;
    backdrop-filter: blur(14px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.45);
    animation: fadeIn 0.3s ease;
}

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

.ai-pin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 14px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--border-subtle);
}

.ai-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ai-avatar {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    object-fit: cover;
    filter: drop-shadow(0 0 6px rgba(0, 200, 255, 0.5));
}

.ai-name {
    font-size: 0.92rem;
    font-weight: 600;
    color: #fff;
}

.ai-timestamp {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.btn-copy {
    background: transparent;
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    width: 28px;
    height: 28px;
    padding: 0;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.btn-copy:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.25);
}

/* AI Markdown Body Styling */
.ai-pin-body {
    font-size: 0.95rem;
    line-height: 1.65;
    color: #e5e7eb;
}

.ai-pin-body h1, .ai-pin-body h2, .ai-pin-body h3 {
    margin-top: 18px;
    margin-bottom: 10px;
    color: #fff;
    letter-spacing: -0.01em;
}

.ai-pin-body h1 { font-size: 1.35rem; }
.ai-pin-body h2 { font-size: 1.15rem; }
.ai-pin-body h3 { font-size: 1.02rem; }

.ai-pin-body p {
    margin-bottom: 12px;
}

.ai-pin-body ul, .ai-pin-body ol {
    margin: 8px 0 16px 22px;
}

.ai-pin-body li {
    margin-bottom: 6px;
}

.ai-pin-body strong {
    color: #ffffff;
    font-weight: 600;
}

.ai-pin-body blockquote {
    border-left: 3px solid var(--neon-cyan);
    padding: 8px 16px;
    margin: 14px 0;
    background: rgba(0, 220, 255, 0.05);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-size: 0.9rem;
    color: #93c5fd;
}

/* Markdown Tables (Sleek Dashboard Look) */
.ai-pin-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
    font-size: 0.88rem;
    background: rgba(14, 16, 22, 0.9);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.ai-pin-body th, .ai-pin-body td {
    padding: 10px 14px;
    text-align: left;
    border-bottom: 1px solid var(--border-subtle);
}

.ai-pin-body th {
    background: rgba(25, 30, 42, 0.95);
    font-weight: 600;
    color: #fff;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.04em;
}

.ai-pin-body tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.ai-pin-body code {
    background: rgba(255, 255, 255, 0.08);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.85em;
    color: #38bdf8;
}

.ai-pin-body pre {
    background: #090b0e;
    border: 1px solid var(--border-subtle);
    padding: 14px;
    border-radius: var(--radius-md);
    overflow-x: auto;
    margin: 14px 0;
}

.ai-pin-body pre code {
    background: transparent;
    padding: 0;
    color: #e2e8f0;
}

/* Minimal Glowing Processing Pulse Dot (Matching image representation) */
.ai-processing-indicator {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    margin: 4px 0;
    width: auto;
    animation: fadeIn 0.25s ease;
}

.processing-pulse-dot {
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: #3b82f6;
    box-shadow: 0 0 10px #3b82f6, 0 0 20px rgba(59, 130, 246, 0.7);
    animation: processingGlow 1.5s infinite ease-in-out;
    flex-shrink: 0;
}

.processing-text {
    font-size: 0.88rem;
    color: var(--text-secondary);
    letter-spacing: 0.02em;
    user-select: none;
    font-weight: 500;
}

@keyframes processingGlow {
    0%, 100% {
        transform: scale(0.9);
        opacity: 0.75;
        box-shadow: 0 0 8px #3b82f6, 0 0 16px rgba(59, 130, 246, 0.5);
    }
    50% {
        transform: scale(1.22);
        opacity: 1;
        box-shadow: 0 0 16px #60a5fa, 0 0 30px rgba(96, 165, 250, 0.9);
    }
}

/* ==========================================================================
   Floating Bottom Dock (Pinterest Pill Style)
   ========================================================================== */

.dock-container {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 10px 20px 20px 20px;
    background: linear-gradient(to top, rgba(7, 8, 10, 0.98) 60%, transparent 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 90;
}

.quick-chips {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
    max-width: 900px;
    width: 100%;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
}

.quick-chips::-webkit-scrollbar { display: none; }

.chip {
    white-space: nowrap;
    background: rgba(22, 26, 35, 0.85);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    backdrop-filter: blur(8px);
    transition: all 0.2s ease;
}

.chip:hover {
    background: rgba(35, 42, 56, 0.95);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.dock-form {
    max-width: 900px;
    width: 100%;
}

.dock-input-wrapper {
    display: flex;
    align-items: center;
    background: rgba(18, 21, 28, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-full);
    padding: 8px 12px 8px 22px;
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.6), 0 0 1px rgba(255, 255, 255, 0.2);
    transition: all 0.25s ease;
}

.dock-input-wrapper:focus-within {
    border-color: var(--neon-cyan);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.7), 0 0 15px rgba(0, 220, 255, 0.25);
    background: rgba(22, 26, 36, 1);
}

.dock-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #fff;
    font-size: 0.95rem;
    resize: none;
    max-height: 120px;
    line-height: 1.45;
    padding: 6px 0;
}

.dock-input::placeholder {
    color: var(--text-muted);
}

.btn-send {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--neon-cyan), var(--neon-blue));
    border: none;
    color: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    margin-left: 10px;
}

.btn-send:hover {
    transform: scale(1.08);
    box-shadow: 0 0 15px rgba(0, 220, 255, 0.6);
}

.btn-send:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.dock-footer-note {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 8px;
    text-align: center;
}

/* ==========================================================================
   Responsive Adaptations
   ========================================================================== */

@media (max-width: 768px) {
    .navbar {
        padding: 12px 16px;
    }
    .brand-sub {
        display: none;
    }
    .main-container {
        padding: 16px 12px 180px 12px;
    }
    .pins-grid {
        grid-template-columns: 1fr;
    }
    .user-bubble {
        max-width: 90%;
    }
}
