
 :root {
    --bg-body: #f5f3f7;
    --bg-panel: #ffffff;
    --bg-chat: #faf9fb;
    --bg-hover: #f9fafb;
    --bg-active: #f8f0fc;
    --primary: #a855f7;
    /* Purple 500 */
    --primary-hover: #9333ea;
    --primary-light: #f3e8ff;
    --primary-soft: #faf5ff;
    --text-main: #1f2937;
    --text-muted: #9ca3af;
    --text-sub: #6b7280;
    --border-light: #f3f4f6;
    --border-dark: #e5e7eb;
    --border-active: #f3e8ff;
    --radius-panel: 24px;
    --font-main: 'Inter', sans-serif;
}
/* ==================== RESET & BASE ==================== */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-body);
    height: 100vh;
    overflow: hidden;
    display: flex;
    padding: 16px;
    gap: 16px;
}

button {
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

input {
    font-family: inherit;
}
/* Scrollbar */

 ::-webkit-scrollbar {
    width: 5px;
}

 ::-webkit-scrollbar-track {
    background: transparent;
}

 ::-webkit-scrollbar-thumb {
    background: #e5e7eb;
    border-radius: 10px;
}

 ::-webkit-scrollbar-thumb:hover {
    background: #d1d5db;
}
/* Utilities */

.hidden {
    display: none !important;
}

.truncate {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* ==================== LAYOUT: SIDEBAR ==================== */

.sidebar {
    width: 320px;
    background: var(--bg-panel);
    border-radius: var(--radius-panel);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    border: 1px solid var(--border-light);
    overflow: hidden;
}

.sidebar-header {
    padding: 20px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-light);
}

.sidebar-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.sidebar-actions button {
    color: var(--primary);
    padding: 6px;
    border-radius: 6px;
    transition: background 0.2s;
}

.sidebar-actions button:hover {
    background: var(--primary-soft);
}

.sidebar-subheader {
    padding: 12px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.05em;
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 16px;
    padding-inline: 8px;
}
/* Designer Group */

.designer-group {
    margin-bottom: 16px;
}

.designer-group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
    margin-bottom: 4px;
}

.designer-group-header:hover {
    background: var(--bg-hover);
}

.designer-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.designer-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--border-dark);
}

.designer-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 2px;
}

.designer-meta {
    font-size: 10px;
    color: var(--text-muted);
}
/* Projects List - FLAT STRUCTURE (no tree lines) */

.projects-list {
    display: block;
    padding-left: 56px;
    /* Align with designer name */
    margin-top: 4px;
}

.project-item {
    position: relative;
    margin-bottom: 4px;
}

.project-card {
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--bg-panel);
}

.project-card:hover {
    background: var(--bg-hover);
    transform: translateX(2px);
}

.project-card.active {
    background: var(--bg-active);
    border-color: var(--border-active);
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2px;
}

.project-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-main);
    flex: 1;
}

.project-badge {
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 2px;
    flex-shrink: 0;
}

.project-badge.new {
    color: var(--primary);
    font-weight: 700;
}

.project-client {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    color: var(--primary);
    font-weight: 500;
    margin-bottom: 4px;
}

.project-preview {
    font-size: 11px;
    color: var(--text-sub);
}

.project-preview.unread {
    color: var(--text-main);
    font-weight: 600;
}
/* ==================== LAYOUT: MAIN CHAT ==================== */

.main-area {
    flex: 1;
    background: var(--bg-panel);
    border-radius: var(--radius-panel);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    position: relative;
    border: 1px solid var(--border-light);
    overflow: hidden;
}

.empty-state {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    background: var(--bg-panel);
    z-index: 10;
}

.empty-state i {
    font-size: 60px;
    margin-bottom: 12px;
    color: var(--border-dark);
}

.active-chat {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    position: relative;
    z-index: 20;
    background: var(--bg-panel);
}
/* Chat Header */

.chat-header {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-panel);
}

.chat-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-header-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--border-dark);
}

.chat-header-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 2px;
}

.chat-header-title h2 {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-main);
}

.chat-header-badge {
    background: var(--primary-light);
    color: var(--primary);
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 99px;
}

.chat-header-meta {
    font-size: 12px;
    color: var(--text-sub);
}

.chat-header-meta span {
    font-weight: 500;
    color: #374151;
}

.chat-header-actions button {
    padding: 8px;
    color: var(--text-muted);
    border-radius: 50%;
    font-size: 20px;
    transition: all 0.2s;
}

.chat-header-actions button:hover {
    background: var(--bg-hover);
    color: var(--text-sub);
}
/* Chat Content & Messages */

.chat-content {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    background: var(--bg-chat);
}

.messages-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 900px;
    margin: 0 auto;
}

.msg-row {
    display: flex;
    flex-direction: column;
    animation: popIn 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.msg-row.left {
    align-items: flex-start;
}

.msg-row.right {
    align-items: flex-end;
    margin-top: 8px;
}

.msg-image {
    width: 100%;
    max-width: 220px;
    border-radius: 12px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    cursor: zoom-in;
    margin-bottom: 8px;
    transition: opacity 0.2s;
}

.msg-image:hover {
    opacity: 0.9;
}

.msg-row.left .msg-image {
    border: 1px solid var(--border-light);
}

.msg-row.right .msg-image {
    border: 1px solid var(--primary-light);
}

.msg-bubble {
    padding: 10px 16px;
    font-size: 13px;
    max-width: 80%;
    line-height: 1.5;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.msg-bubble.left {
    background: var(--bg-panel);
    border: 1px solid var(--border-dark);
    color: var(--text-main);
    border-radius: 16px 16px 16px 2px;
}

.msg-bubble.right {
    background: var(--primary);
    color: white;
    border-radius: 16px 16px 2px 16px;
}

.msg-time {
    font-size: 9px;
    margin-top: 4px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    color: var(--text-muted);
}

.msg-bubble.right .msg-time {
    color: var(--primary-light);
}

.order-card {
    min-width: 200px;
    background: var(--bg-panel);
    border-radius: 12px;
    color: var(--text-main);
    border: 1px solid var(--border-light);
    overflow: hidden;
    margin-top: 4px;
}

.order-card-header {
    background: var(--bg-hover);
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 700;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--primary);
}

.order-card-body {
    padding: 12px;
}

.order-card-row {
    font-size: 11px;
    margin-bottom: 6px;
}

.order-card-label {
    font-weight: 700;
    color: var(--text-muted);
}

.order-card-btn {
    width: 100%;
    background: var(--primary-light);
    color: var(--primary-hover);
    font-size: 11px;
    font-weight: 700;
    padding: 8px;
    border-radius: 8px;
    margin-top: 8px;
    transition: background 0.2s;
}

.order-card-btn:hover {
    background: #e9d5ff;
}
/* Input Area */

.input-area {
    padding: 16px 24px;
    background: var(--bg-panel);
    border-top: 1px solid var(--bg-body);
}

.input-wrapper {
    border: 1px solid var(--border-dark);
    border-radius: 99px;
    padding: 6px 8px;
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-panel);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
    transition: all 0.2s;
}

.input-wrapper:focus-within {
    border-color: #d8b4fe;
    box-shadow: 0 0 0 2px var(--primary-soft);
}

.btn-ai {
    background: var(--primary);
    color: white;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    transition: background 0.2s;
}

.btn-ai:hover {
    background: var(--primary-hover);
}

.input-box {
    flex: 1;
    border: none;
    outline: none;
    font-size: 13px;
    color: var(--text-main);
    background: transparent;
}

.input-box::placeholder {
    color: var(--text-muted);
}

.input-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    padding-right: 8px;
}

.input-actions button {
    padding: 6px;
    color: var(--text-muted);
    border-radius: 50%;
    font-size: 20px;
    transition: all 0.2s;
}

.input-actions button:hover {
    color: var(--primary);
    background: var(--primary-soft);
}

.btn-send {
    color: var(--primary) !important;
    margin-left: 4px;
}

.drop-overlay {
    position: absolute;
    inset: 0;
    background: rgba(250, 245, 255, 0.9);
    border: 2px dashed #d8b4fe;
    z-index: 30;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    margin: 70px 0 80px 0;
}

.drop-overlay.active {
    display: flex;
}

.drop-overlay i {
    font-size: 48px;
    margin-bottom: 8px;
    animation: bounce 1s infinite;
}

.drop-overlay p {
    font-weight: 700;
    font-size: 18px;
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(4px);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    transition: opacity 0.3s;
    cursor: zoom-out;
}

.modal.active {
    display: flex;
    opacity: 1;
}

.modal-close {
    position: absolute;
    top: 24px;
    right: 24px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 36px;
    z-index: 110;
}

.modal-close:hover {
    color: white;
}

.modal-img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    transform: scale(0.95);
    transition: transform 0.3s;
}

.modal.active .modal-img {
    transform: scale(1);
}

@keyframes popIn {
    0% {
        opacity: 0;
        transform: scale(0.95) translateY(10px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes bounce {
    0%,
    100% {
        transform: translateY(-25%);
        animation-timing-function: cubic-bezier(0.8, 0, 1, 1);
    }
    50% {
        transform: none;
        animation-timing-function: cubic-bezier(0, 0, 0.2, 1);
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.animate-spin {
    animation: spin 1s linear infinite;
}
