@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@300;400;600;700&family=Montserrat:wght@200;300;400;500;600&display=swap');

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

:root {
    --cream: #F8F6F1;
    --charcoal: #2B2826;
    --stone: #9B8F82;
    --sand: #D4C5B2;
    --ink: #1A1A1A;
    --accent: #8B7355;
    --border: #E5DFD5;
}

body {
    font-family: 'Montserrat', sans-serif;
    background: var(--cream);
    color: var(--charcoal);
    overflow: hidden;
    height: 100vh;
}

/* Fabric Canvas Background */
#fabric-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    opacity: 0.4;
}

/* Main Container */
.atelier-container {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.atelier-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 3rem;
    border-bottom: 1px solid var(--border);
    background: rgba(248, 246, 241, 0.95);
    backdrop-filter: blur(10px);
}

.studio-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.brand-mark {
    width: 8px;
    height: 32px;
    background: linear-gradient(180deg, var(--charcoal) 0%, var(--accent) 100%);
}

.studio-brand h1 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: 2px;
    color: var(--ink);
}

.brand-tagline {
    font-size: 0.75rem;
    font-weight: 300;
    letter-spacing: 1px;
    color: var(--stone);
    text-transform: uppercase;
}

.studio-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--charcoal);
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #4CAF50;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Main Grid */
.studio-grid {
    display: grid;
    grid-template-columns: 380px 1fr;
    flex: 1;
    overflow: hidden;
}

/* Agent Collection (Left Panel) - Teams-style */
.agent-collection {
    background: #f5f5f5;
    border-right: 1px solid #e0e0e0;
    padding: 1.5rem 0.75rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.collection-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--ink);
    margin: 0 0.75rem 0.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #e0e0e0;
}

.collection-subtitle {
    font-size: 0.75rem;
    color: #6b6b6b;
    font-weight: 400;
    margin: 0 0.75rem 1rem;
}

/* Agent Cards - Teams-style */
.agent-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    margin: 0;
}

.agent-card:hover {
    background: #e8e8e8;
}

.agent-card.active {
    background: #FFFFFF;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.agent-persona {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #000000 0%, #2a2a2a 100%);
    border-radius: 50%;
    color: #FFFFFF;
    flex-shrink: 0;
    border: 2px solid #c9a961;
}

.persona-initial {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    color: #c9a961;
}

.agent-details {
    flex: 1;
}

.agent-details h3 {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--ink);
    margin-bottom: 0.15rem;
}

.agent-role {
    font-size: 0.75rem;
    color: #6b6b6b;
    font-weight: 400;
    margin-bottom: 0;
    line-height: 1.3;
}

.agent-metric {
    font-size: 0.75rem;
    color: #c9a961;
    font-weight: 500;
    margin-bottom: 0;
    display: none;
}

.agent-details p {
    font-size: 0.8125rem;
    color: var(--stone);
    font-weight: 400;
    margin-bottom: 0.5rem;
}

.agent-status {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.75rem;
    color: var(--charcoal);
}

.status-dot {
    width: 6px;
    height: 6px;
    background: #4CAF50;
    border-radius: 50%;
}

/* Tech Stack */
.tech-stack {
    margin-top: auto;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.tech-label {
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--stone);
    margin-bottom: 0.75rem;
}

.tech-badges {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.tech-badge {
    font-size: 0.75rem;
    padding: 0.5rem 0.75rem;
    background: #FFFFFF;
    border: 1px solid var(--border);
    border-radius: 3px;
    color: var(--charcoal);
    font-weight: 500;
}

/* Agent Workspace (Right Panel) */
.agent-workspace {
    position: relative;
    background: rgba(255, 255, 255, 0.5);
    overflow: hidden;
}

/* Welcome Screen */
.welcome-screen {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 3rem 2rem;
    opacity: 1;
    transition: opacity 0.4s ease;
    background: #f5f5f5;
    overflow-y: auto;
}

.welcome-screen.hidden {
    opacity: 0;
    pointer-events: none;
}

.welcome-content {
    width: 100%;
    max-width: 850px;
}

/* Welcome Memo - Email Style */
.welcome-memo {
    background: #FFFFFF;
    border-radius: 4px;
    border: 1px solid #d1d1d1;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
    overflow: hidden;
}

.memo-header {
    background: #FFFFFF;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #e5e5e5;
}

.email-meta-line {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 0.875rem;
}

.email-subject {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #e5e5e5;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.meta-label {
    color: #737373;
    font-weight: 400;
    min-width: 50px;
}

.meta-value {
    color: #1f1f1f;
    font-weight: 400;
}

.subject-text {
    color: #000;
    font-weight: 600;
    font-size: 1rem;
}

.memo-body {
    padding: 2rem 2.5rem;
    line-height: 1.65;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.memo-greeting {
    font-size: 1rem;
    font-weight: 600;
    color: #000;
    margin-bottom: 1.25rem;
}

.memo-body > p {
    font-size: 0.9375rem;
    color: #1f1f1f;
    margin-bottom: 1rem;
    line-height: 1.65;
}

.team-intro {
    margin: 1.5rem 0;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.intro-section {
    padding: 1.25rem 0;
    background: transparent;
    border: none;
    border-bottom: 1px solid #f0f0f0;
}

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

.person-header {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
}

.person-name {
    font-size: 0.9375rem;
    font-weight: 600;
    color: #000;
}

.person-email {
    font-size: 0.8125rem;
    color: #5b21b6;
    font-weight: 400;
}

.intro-label {
    font-size: 0.8125rem;
    font-weight: 400;
    color: #737373;
    margin-bottom: 0.5rem;
    font-style: italic;
}

.intro-section > p:not(.intro-label) {
    font-size: 0.9375rem;
    color: #1f1f1f;
    line-height: 1.65;
    margin: 0;
}

.memo-closing {
    font-size: 0.9375rem;
    color: #1f1f1f;
    margin: 1.5rem 0 1rem;
    font-weight: 400;
    line-height: 1.65;
}

.memo-signature {
    margin-top: 2rem;
    padding-top: 0;
    border-top: none;
}

.memo-signature p {
    font-size: 0.9375rem;
    color: #1f1f1f;
    margin-bottom: 0.15rem;
    line-height: 1.6;
}

.signature-divider {
    color: #d1d1d1;
    margin: 0.75rem 0;
    font-weight: 300;
}

.signature-tech {
    font-size: 0.75rem;
    color: #999;
    font-weight: 400;
    margin-top: 1rem;
}

/* Active Workspace */
.active-workspace {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.active-workspace.visible {
    opacity: 1;
    pointer-events: all;
}

.workspace-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 2rem;
    border-bottom: 1px solid var(--border);
    background: #FFFFFF;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.agent-profile {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.profile-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #000000 0%, #2a2a2a 100%);
    border: 2px solid #c9a961;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 600;
    color: #c9a961;
    letter-spacing: 0.05em;
}

.profile-info h2 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--ink);
    margin-bottom: 0.15rem;
}

.profile-info p {
    font-size: 0.8125rem;
    color: var(--stone);
    font-weight: 400;
    margin-bottom: 0.35rem;
}

.profile-status {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.75rem;
    color: #10b981;
    font-weight: 500;
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.close-workspace {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--charcoal);
}

.close-workspace:hover {
    background: var(--charcoal);
    border-color: var(--charcoal);
    color: #FFFFFF;
}

.close-workspace svg {
    width: 18px;
    height: 18px;
}

/* Chat Container */
.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #f5f5f5;
}

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

/* Message Styles - Teams/Email-like */
.message {
    display: flex;
    gap: 0.75rem;
    max-width: 100%;
    margin-bottom: 1.5rem;
}

.message.user {
    flex-direction: row-reverse;
}

.message.agent {
    flex-direction: row;
}

.message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #000000 0%, #2a2a2a 100%);
    border: 2px solid #c9a961;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: #c9a961;
    flex-shrink: 0;
}

.message.user .message-avatar {
    background: var(--charcoal);
    border-color: var(--charcoal);
    color: #FFFFFF;
}

.message-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.message-header {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}

.message-sender {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--ink);
}

.message-time {
    font-size: 0.75rem;
    color: var(--stone);
    font-weight: 400;
}

.message-content {
    padding: 0.875rem 1.125rem;
    border-radius: 8px;
    font-size: 0.9375rem;
    line-height: 1.65;
    white-space: pre-wrap;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    max-width: 75%;
}

.message.user .message-content {
    background: #5b21b6;
    color: #FFFFFF;
    border-radius: 12px 12px 2px 12px;
    align-self: flex-end;
}

.message.agent .message-content {
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    color: var(--charcoal);
    border-radius: 12px 12px 12px 2px;
}

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

.loading-dots {
    display: flex;
    gap: 0.25rem;
}

.loading-dots span {
    width: 6px;
    height: 6px;
    background: var(--stone);
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out;
}

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

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

/* Teams-style Compose Box */
.compose-box {
    padding: 1rem 1.5rem 1.5rem;
    background: #FFFFFF;
    border-top: 1px solid #e0e0e0;
}

.compose-wrapper {
    display: flex;
    align-items: flex-end;
    gap: 0.75rem;
    background: #FFFFFF;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    transition: border-color 0.2s ease;
}

.compose-wrapper:focus-within {
    border-color: #5b21b6;
}

#chat-input {
    flex: 1;
    padding: 0.5rem;
    border: none;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 0.9375rem;
    color: var(--charcoal);
    background: transparent;
    resize: none;
    max-height: 120px;
    line-height: 1.5;
}

#chat-input:focus {
    outline: none;
}

#chat-input::placeholder {
    color: #6b6b6b;
}

.send-button {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #5b21b6;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #FFFFFF;
    flex-shrink: 0;
}

.send-button:hover {
    background: #6d28d9;
    transform: scale(1.05);
}

.send-button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

.send-button svg {
    width: 18px;
    height: 18px;
}

/* Quick Actions */
.quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: #FFFFFF;
    border-top: 1px solid #e0e0e0;
}

.quick-action-btn {
    padding: 0.5rem 1rem;
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 16px;
    font-size: 0.8125rem;
    color: var(--charcoal);
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-weight: 500;
}

.quick-action-btn:hover {
    background: #5b21b6;
    border-color: #5b21b6;
    color: #FFFFFF;
}

/* Welcome CTA */
.welcome-cta {
    margin-top: 3rem;
    text-align: center;
}

.cta-label {
    font-size: 0.875rem;
    color: var(--stone);
    margin-bottom: 1rem;
}

.cta-button {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 2rem;
    background: var(--charcoal);
    color: #FFFFFF;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.cta-button:hover {
    background: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 115, 85, 0.3);
}

.cta-button svg {
    width: 18px;
    height: 18px;
}

/* Agent Interaction Panel */
.agent-interaction-panel {
    flex: 1;
    padding: 3rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.interaction-info {
    display: flex;
    gap: 1.5rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.info-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--charcoal) 0%, var(--accent) 100%);
    border-radius: 50%;
    color: #FFFFFF;
}

.info-icon svg {
    width: 24px;
    height: 24px;
}

.info-content h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--ink);
    margin-bottom: 0.75rem;
}

.info-content p {
    font-size: 0.9375rem;
    color: var(--charcoal);
    line-height: 1.6;
    margin-bottom: 0.5rem;
}

.info-content strong {
    color: var(--accent);
}

.agent-address-label {
    font-size: 0.75rem;
    color: var(--stone);
    margin-top: 0.5rem;
}

.agent-address-label code {
    font-family: 'Courier New', monospace;
    background: rgba(0, 0, 0, 0.05);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.6875rem;
}

/* Example Queries */
.example-queries {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.example-queries h4 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--ink);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.example-query {
    padding: 1rem;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.875rem;
    color: var(--charcoal);
    font-family: 'Courier New', monospace;
}

/* Launch Actions */
.launch-actions {
    display: flex;
    gap: 1rem;
    margin-top: auto;
}

.launch-button {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1.25rem 2rem;
    border-radius: 8px;
    font-size: 0.9375rem;
    font-weight: 500;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.launch-button svg {
    width: 20px;
    height: 20px;
}

.launch-button.primary {
    background: var(--charcoal);
    color: #FFFFFF;
}

.launch-button.primary:hover {
    background: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 115, 85, 0.3);
}

.launch-button.secondary {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid var(--border);
    color: var(--charcoal);
}

.launch-button.secondary:hover {
    border-color: var(--accent);
    background: rgba(255, 255, 255, 1);
}

/* Footer */
.atelier-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 3rem;
    border-top: 1px solid var(--border);
    background: rgba(248, 246, 241, 0.95);
    font-size: 0.75rem;
    color: var(--stone);
}

.footer-info, .footer-tech {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.footer-tech a {
    color: var(--stone);
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-tech a:hover {
    color: var(--accent);
}

/* Scrollbar Styles */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

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

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

/* Responsive */
@media (max-width: 1024px) {
    .studio-grid {
        grid-template-columns: 1fr;
    }

    .agent-collection {
        display: none;
    }
}
