/* CSS Variables for Modern Design System */
:root {
    --primary-bg: #0a0e27;
    --secondary-bg: rgba(20, 30, 48, 0.85);
    --surface-bg: rgba(30, 41, 59, 0.7);
    --accent-primary: #FF9900;
    --accent-secondary: #00D9FF;
    --accent-purple: #A78BFA;
    --text-primary: #F8FAFC;
    --text-secondary: #94A3B8;
    --border-subtle: rgba(255, 255, 255, 0.08);
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 24px 80px rgba(0, 0, 0, 0.6);
    --transition-smooth: cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    transition-timing-function: var(--transition-smooth);
}

body {
    font-family: 'Inter var', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    letter-spacing: -0.011em;
    background: linear-gradient(135deg, #0a0e27 0%, #16213e 100%);
    color: var(--text-primary);
    height: 100vh;
    overflow: hidden;
}

/* Modern Scrollbars */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}
::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.5);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, rgba(255, 153, 0, 0.6), rgba(0, 217, 255, 0.6));
    border-radius: 10px;
    border: 2px solid rgba(15, 23, 42, 0.5);
}
::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, rgba(255, 153, 0, 0.8), rgba(0, 217, 255, 0.8));
}
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 153, 0, 0.6) rgba(15, 23, 42, 0.5);
}

/* Accessibility Focus States */
button:focus-visible, input:focus-visible, textarea:focus-visible {
    outline: 2px solid var(--accent-secondary);
    outline-offset: 2px;
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

.app-container {
    display: grid;
    grid-template-columns: 120px 1fr 380px;
    grid-template-rows: 60px 1fr;
    height: 100vh;
    transition: grid-template-columns 0.3s ease;
}

.app-container.sidebar-expanded {
    grid-template-columns: 280px 1fr 380px;
}

/* Header - Modern Glassmorphism */
header {
    grid-column: 1 / -1;
    background: rgba(20, 30, 48, 0.9);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    padding: 0 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 153, 0, 0.3);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #FF9900 0%, #00D9FF 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(255, 153, 0, 0.3);
}

.logo h1 {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    background: linear-gradient(135deg, #FF9900 0%, #00D9FF 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    font-size: 0.85rem;
    font-weight: 500;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #4CAF50;
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
    box-shadow: 0 0 12px currentColor;
}

.status-dot.disconnected { background: #f44336; animation: none; }

@keyframes pulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 12px currentColor; }
    50% { opacity: 0.5; box-shadow: 0 0 6px currentColor; }
}

/* Main diagram area */
.diagram-panel {
    background: #fff;
    position: relative;
    overflow: auto;
}

.diagram-container {
    min-height: 100%;
    padding: 2rem;
    display: flex;
    flex-direction: column;
}

.diagram-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
}

.diagram-header h2 {
    color: #232F3E;
    font-size: 1rem;
}

.component-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.pill {
    padding: 0.25rem 0.6rem;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.pill.compute { background: #FF9900; color: white; }
.pill.storage { background: #3F8624; color: white; }
.pill.database { background: #3B48CC; color: white; }
.pill.networking { background: #8C4FFF; color: white; }
.pill.security { background: #DD344C; color: white; }
.pill.integration { background: #FF4F8B; color: white; }
.pill.serverless { background: #FF9900; color: white; }
.pill.unknown { background: #666; color: white; }

#diagram {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 400px;
    overflow: auto;
}

#diagram svg {
    max-width: 100%;
    min-width: 300px;
    min-height: 300px;
    height: auto;
}

#mermaidView #diagram {
    background: #1a1a2e;
    border-radius: 8px;
    padding: 1rem;
}

.empty-state {
    text-align: center;
    color: #666;
    padding: 3rem;
}

.empty-state svg {
    width: 80px;
    height: 80px;
    margin-bottom: 1rem;
    opacity: 0.3;
}

/* Chat panel - Glassmorphism */
.chat-panel {
    grid-row: 2;
    grid-column: 3;
    background: var(--secondary-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: flex;
    flex-direction: column;
    border-left: 1px solid rgba(255, 255, 255, 0.08);
    overflow: hidden;
    min-height: 0;
    max-height: calc(100vh - 60px);
}

.chat-header {
    padding: 1.25rem;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 2px solid rgba(255, 153, 0, 0.15);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.chat-header h2 {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.transcript-input {
    display: flex;
    gap: 0.5rem;
}

.transcript-input textarea {
    flex: 1;
    background: #0f0f1a;
    border: 1px solid #333;
    border-radius: 6px;
    padding: 0.5rem;
    color: #eee;
    font-size: 0.8rem;
    resize: none;
    height: 60px;
}

.transcript-input textarea:focus {
    outline: none;
    border-color: #FF9900;
}

.transcript-input button {
    background: linear-gradient(135deg, #FF9900 0%, #FF7B00 100%);
    border: none;
    border-radius: 8px;
    padding: 0 1.25rem;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s var(--transition-smooth);
    box-shadow: 0 4px 12px rgba(255, 153, 0, 0.3);
}

.transcript-input button:hover {
    background: linear-gradient(135deg, #FFB000 0%, #FF9900 100%);
    box-shadow: 0 6px 20px rgba(255, 153, 0, 0.4);
    transform: translateY(-2px);
}

.transcript-input button:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(255, 153, 0, 0.3);
}

/* Chat messages - Modern Cards */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.message {
    max-width: 95%;
    padding: 1rem 1.25rem;
    border-radius: 16px;
    font-size: 0.95rem;
    line-height: 1.65;
    letter-spacing: -0.006em;
    font-weight: 450;
    animation: fadeIn 0.3s var(--transition-smooth);
    transition: all 0.2s var(--transition-smooth);
}

.message:hover {
    transform: translateY(-1px);
}

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

.message.user {
    background: linear-gradient(135deg, #FF9900 0%, #FF7B00 100%);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
    box-shadow: 0 4px 16px rgba(255, 153, 0, 0.25);
}

.message.user:hover {
    box-shadow: 0 6px 20px rgba(255, 153, 0, 0.35);
}

.message.assistant {
    background: rgba(30, 41, 59, 0.8);
    color: var(--text-primary);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(20px);
}

.message.assistant:hover {
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 255, 255, 0.15);
}

.message.system {
    background: rgba(255, 153, 0, 0.1);
    color: #FF9900;
    align-self: center;
    font-size: 0.85rem;
    border: 1px dashed rgba(255, 153, 0, 0.5);
    backdrop-filter: blur(10px);
}

.message.streaming {
    border: 1px solid rgba(255, 153, 0, 0.5);
}

.message.streaming::after {
    content: '▊';
    color: var(--accent-secondary);
    margin-left: 2px;
    animation: blink 0.8s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* Thinking Animation */
.thinking-dots {
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.thinking-dots span {
    animation: dotPulse 1.4s infinite;
    opacity: 0.3;
}

.thinking-dots span:nth-child(2) { animation-delay: 0.2s; }
.thinking-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes dotPulse {
    0%, 60%, 100% { opacity: 0.3; }
    30% { opacity: 1; }
}

/* Live thinking text - Shimmer Effect */
.thinking-live {
    color: var(--text-secondary);
    font-style: italic;
    line-height: 1.5;
    background: linear-gradient(90deg, #94A3B8 0%, #00D9FF 50%, #94A3B8 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shimmer 2s linear infinite;
}

@keyframes shimmer {
    to { background-position: 200% center; }
}

/* Environment Containers (Datacenter boxes) */
.env-container {
    position: absolute;
    border: 3px solid;
    border-radius: 16px;
    min-width: 300px;
    min-height: 200px;
    padding: 50px 20px 20px 20px;
    transition: all 0.3s ease;
}

.env-container.aws {
    background: rgba(255, 153, 0, 0.05);
    border-color: #FF9900;
}

.env-container.onprem {
    background: rgba(102, 102, 102, 0.05);
    border-color: #666;
}

.env-container.azure {
    background: rgba(0, 120, 212, 0.05);
    border-color: #0078D4;
}

.env-container.gcp {
    background: rgba(66, 133, 244, 0.05);
    border-color: #4285F4;
}

.env-container-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 10px 15px;
    border-radius: 13px 13px 0 0;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.env-container.aws .env-container-header {
    background: linear-gradient(135deg, #FF9900, #ec7211);
    color: white;
}

.env-container.onprem .env-container-header {
    background: linear-gradient(135deg, #666, #444);
    color: white;
}

.env-container.azure .env-container-header {
    background: linear-gradient(135deg, #0078D4, #005a9e);
    color: white;
}

.env-container.gcp .env-container-header {
    background: linear-gradient(135deg, #4285F4, #3367d6);
    color: white;
}

.env-container-header .env-icon {
    font-size: 1.2rem;
}

.env-container-header .env-label {
    flex: 1;
}

.env-container-header .env-badge {
    font-size: 0.65rem;
    padding: 2px 8px;
    background: rgba(255,255,255,0.2);
    border-radius: 10px;
}

.env-container .env-content {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    padding: 10px;
    min-height: 100px;
}

/* Components inside environment containers */
.env-container .arch-component {
    position: relative !important;
    transform: none !important;
}

/* Formatted AI Response Styles */
.response-main {
    margin-bottom: 0.75rem;
    line-height: 1.6;
}

.response-insights,
.response-recommendations,
.response-gaps {
    margin-top: 0.75rem;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.85rem;
}

.response-insights {
    background: rgba(255, 193, 7, 0.1);
    border-left: 3px solid #FFC107;
}

.response-recommendations {
    background: rgba(76, 175, 80, 0.1);
    border-left: 3px solid #4CAF50;
}

.response-gaps {
    background: rgba(33, 150, 243, 0.1);
    border-left: 3px solid #2196F3;
    font-size: 0.8rem;
    color: #aaa;
}

.response-insights ul,
.response-recommendations ul {
    margin: 0.5rem 0 0 1rem;
    padding: 0;
}

.response-insights li,
.response-recommendations li {
    margin-bottom: 0.3rem;
}

.response-gaps span {
    display: block;
    margin-top: 0.3rem;
    font-style: italic;
}

/* Suggested questions - Premium Panel */
.suggested-questions {
    padding: 1.25rem 1.5rem;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    max-height: 300px;
    overflow-y: auto;
    flex-shrink: 0;
}

.suggested-questions h3 {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.question-btn {
    display: block;
    width: 100%;
    text-align: left;
    padding: 0.875rem 1.25rem;
    margin-bottom: 0.5rem;
    background: rgba(30, 41, 59, 0.6);
    border: 1.5px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.3s var(--transition-smooth);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

.question-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.question-btn:active::before {
    width: 400px;
    height: 400px;
}

.question-btn:hover {
    background: linear-gradient(135deg, #FF9900 0%, #FF7B00 100%);
    border-color: rgba(255, 153, 0, 0.5);
    color: white;
    transform: translateX(8px) translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 153, 0, 0.3);
}

.question-btn:active {
    transform: translateX(8px) scale(0.98);
}

/* Template selection buttons */
.question-btn.template-btn {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
    padding: 1rem;
}

.question-btn.template-btn i {
    font-size: 1.1rem;
    margin-right: 0.5rem;
}

.question-btn .btn-hint {
    font-size: 0.7rem;
    color: #888;
    font-weight: 400;
    margin-left: 1.6rem;
}

.question-btn:hover .btn-hint {
    color: rgba(255,255,255,0.7);
}

/* Multiple Choice Answer Options */
.answer-options-container {
    padding: 0.75rem 1rem;
    background: linear-gradient(180deg, #1a1a2e 0%, #16213e 100%);
    border-top: 2px solid #FF9900;
    max-height: 350px;
    overflow-y: auto;
    flex-shrink: 0;
}

.current-question {
    font-size: 0.95rem;
    color: #FF9900;
    font-weight: 600;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #333;
}

.question-context {
    font-size: 0.75rem;
    color: #888;
    margin-bottom: 0.75rem;
    font-style: italic;
}

.answer-options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.answer-option {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: rgba(255,255,255,0.03);
    border: 1px solid #333;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.answer-option:hover {
    background: rgba(255, 153, 0, 0.15);
    border-color: #FF9900;
    transform: translateX(4px);
}

.answer-option.selected {
    background: rgba(255, 153, 0, 0.25);
    border-color: #FF9900;
    box-shadow: 0 0 10px rgba(255, 153, 0, 0.2);
}

.option-marker {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: #888;
    flex-shrink: 0;
}

.answer-option:hover .option-marker {
    background: #FF9900;
    color: white;
}

.answer-option.selected .option-marker {
    background: #FF9900;
    color: white;
}

.option-content {
    flex: 1;
}

.option-label {
    font-size: 0.9rem;
    color: #eee;
    font-weight: 500;
    margin-bottom: 0.2rem;
}

.option-description {
    font-size: 0.75rem;
    color: #888;
}

/* Custom answer input */
.custom-answer-input {
    display: none;
    margin-top: 0.5rem;
    padding: 0.5rem;
    background: #0f0f1a;
    border: 1px solid #333;
    border-radius: 6px;
}

.custom-answer-input.visible {
    display: block;
}

.custom-answer-input input {
    width: 100%;
    padding: 0.5rem;
    background: transparent;
    border: none;
    color: #eee;
    font-size: 0.85rem;
}

.custom-answer-input input:focus {
    outline: none;
}

/* Quick action buttons for selected option */
.option-actions {
    display: none;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #333;
}

.option-actions.visible {
    display: flex;
}

.submit-answer-btn {
    flex: 1;
    padding: 0.75rem 1.25rem;
    background: linear-gradient(135deg, #FF9900 0%, #FF7B00 100%);
    border: none;
    border-radius: 10px;
    color: white;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s var(--transition-smooth);
    box-shadow: 0 4px 12px rgba(255, 153, 0, 0.3);
    position: relative;
    overflow: hidden;
}

.submit-answer-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.submit-answer-btn:active::before {
    width: 300px;
    height: 300px;
}

.submit-answer-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 153, 0, 0.4);
}

.submit-answer-btn:active {
    transform: translateY(0);
}

.skip-question-btn {
    padding: 0.6rem 1rem;
    background: transparent;
    border: 1px solid #666;
    border-radius: 6px;
    color: #888;
    font-size: 0.85rem;
    cursor: pointer;
}

.skip-question-btn:hover {
    border-color: #FF9900;
    color: #FF9900;
}

/* Progress indicator */
.discovery-progress {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: #0f0f1a;
    font-size: 0.75rem;
    color: #888;
}

.progress-bar {
    flex: 1;
    height: 4px;
    background: #333;
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #FF9900, #FF4F8B);
    transition: width 0.3s ease;
}

/* Chat input - Modern Premium Feel */
.chat-input-container {
    padding: 1.25rem;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
    margin-top: auto;
}

.chat-input-wrapper {
    display: flex;
    gap: 0.75rem;
}

.chat-input {
    flex: 1;
    background: rgba(15, 23, 42, 0.9);
    border: 1.5px solid rgba(255, 255, 255, 0.12);
    border-radius: 24px;
    padding: 0.875rem 1.25rem;
    color: var(--text-primary);
    font-size: 0.95rem;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.3);
    transition: all 0.3s var(--transition-smooth);
}

.chat-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(255, 153, 0, 0.15),
                inset 0 2px 8px rgba(0, 0, 0, 0.3);
    transform: translateY(-1px);
}

.chat-input::placeholder {
    color: var(--text-secondary);
}

.send-btn {
    background: linear-gradient(135deg, #FF9900 0%, #FF7B00 100%);
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s var(--transition-smooth);
    box-shadow: 0 4px 12px rgba(255, 153, 0, 0.3),
                0 2px 4px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

.send-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.send-btn:active::before {
    width: 200px;
    height: 200px;
}

.send-btn:hover {
    background: linear-gradient(135deg, #FFB000 0%, #FF9900 100%);
    box-shadow: 0 6px 20px rgba(255, 153, 0, 0.4),
                0 3px 6px rgba(0, 0, 0, 0.25);
    transform: translateY(-2px);
}

.send-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(255, 153, 0, 0.3);
}

.send-btn svg {
    width: 20px;
    height: 20px;
    fill: white;
    position: relative;
    z-index: 1;
}

/* Insights panel */
.insights-panel {
    background: rgba(255, 153, 0, 0.1);
    border: 1px solid #FF9900;
    border-radius: 8px;
    padding: 0.75rem;
    margin: 0 1rem 1rem;
}

.insights-panel h3 {
    font-size: 0.75rem;
    color: #FF9900;
    margin-bottom: 0.5rem;
}

.insights-panel ul {
    list-style: none;
    font-size: 0.85rem;
    color: #ccc;
}

.insights-panel li {
    padding: 0.25rem 0;
    padding-left: 1rem;
    position: relative;
}

.insights-panel li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.6rem;
    width: 6px;
    height: 6px;
    background: #FF9900;
    border-radius: 50%;
}

/* Controls */
.diagram-controls {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    display: flex;
    gap: 0.5rem;
}

.control-btn {
    padding: 0.5rem 1rem;
    background: #232F3E;
    border: none;
    border-radius: 6px;
    color: white;
    font-size: 0.8rem;
    cursor: pointer;
    transition: background 0.2s;
}

.control-btn:hover {
    background: #FF9900;
}

/* Mode toggle - Modern Pills */
.mode-toggle {
    display: flex;
    gap: 0.25rem;
    background: rgba(15, 15, 26, 0.8);
    padding: 0.35rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.mode-btn {
    padding: 0.5rem 1rem;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s var(--transition-smooth);
}

.mode-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.mode-btn.active {
    background: linear-gradient(135deg, #FF9900, #FF7B00);
    color: white;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(255, 153, 0, 0.3);
}

/* Live HTML Canvas Architecture */
.live-canvas {
    width: 100%;
    height: 100%;
    position: relative;
    background:
        linear-gradient(rgba(148, 163, 184, 0.15) 1px, transparent 1px),
        linear-gradient(90deg, rgba(148, 163, 184, 0.15) 1px, transparent 1px),
        linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    background-size: 24px 24px, 24px 24px, 100% 100%;
    min-height: calc(100vh - 120px);
    overflow: auto;
}

.canvas-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.arch-tier {
    position: absolute;
    border-radius: 12px;
    padding: 1rem;
    border: 2px dashed;
    min-width: 200px;
}

.arch-tier.web {
    background: rgba(140, 79, 255, 0.08);
    border-color: #8C4FFF;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
}
.arch-tier.app {
    background: rgba(255, 153, 0, 0.08);
    border-color: #FF9900;
    top: 180px;
    left: 50%;
    transform: translateX(-50%);
}
.arch-tier.data {
    background: rgba(59, 72, 204, 0.08);
    border-color: #3B48CC;
    top: 340px;
    left: 50%;
    transform: translateX(-50%);
}

.tier-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    font-weight: 800;
    letter-spacing: 0.08em;
    margin-bottom: 0.75rem;
    opacity: 0.8;
}

.tier-components {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
}

.arch-component {
    background: white;
    border-radius: 10px;
    padding: 0.875rem 1.125rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12),
                0 2px 4px rgba(0, 0, 0, 0.08);
    border-left: 4px solid;
    border-right: 1px solid rgba(255, 255, 255, 0.15);
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.825rem;
    font-weight: 600;
    color: #333;
    transition: all 0.3s var(--transition-smooth);
    animation: componentPop 0.3s var(--transition-smooth);
    min-width: 120px;
    cursor: grab;
    user-select: none;
}

.arch-component.dragging {
    cursor: grabbing;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
    transform: scale(1.05) rotate(2deg);
    z-index: 1000;
    opacity: 0.95;
}

.arch-component.free-placed {
    position: absolute;
}

@keyframes componentPop {
    0% { transform: scale(0.85) translateY(10px); opacity: 0; }
    60% { transform: scale(1.02) translateY(-2px); }
    100% { transform: scale(1) translateY(0); opacity: 1; }
}

.arch-component:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18),
                0 4px 8px rgba(0, 0, 0, 0.12);
}

.arch-component.compute { border-color: #FF9900; }
.arch-component.storage { border-color: #3F8624; }
.arch-component.database { border-color: #3B48CC; }
.arch-component.networking { border-color: #8C4FFF; }
.arch-component.security { border-color: #DD344C; }
.arch-component.serverless { border-color: #FF9900; }
.arch-component.integration { border-color: #FF4F8B; }
.arch-component.ai_ml { border-color: #01A88D; }
.arch-component.containers { border-color: #FF9900; }
.arch-component.devops { border-color: #CC2264; }

/* Flow demo highlight animation */
.arch-component.flow-highlight {
    animation: flowPulse 1.5s ease-in-out;
    box-shadow: 0 0 20px rgba(255, 153, 0, 0.8), 0 4px 12px rgba(0,0,0,0.15);
}

@keyframes flowPulse {
    0% { transform: scale(1); box-shadow: 0 0 0 rgba(255, 153, 0, 0); }
    25% { transform: scale(1.1); box-shadow: 0 0 30px rgba(255, 153, 0, 1); }
    50% { transform: scale(1.05); box-shadow: 0 0 20px rgba(255, 153, 0, 0.7); }
    75% { transform: scale(1.08); box-shadow: 0 0 25px rgba(255, 153, 0, 0.5); }
    100% { transform: scale(1); box-shadow: 0 0 0 rgba(255, 153, 0, 0); }
}

/* Flow demo status indicator */
.flow-demo-status {
    position: fixed;
    top: 70px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #FF9900, #FF4F8B);
    color: white;
    padding: 0.5rem 1.5rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    z-index: 1000;
    display: none;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 15px rgba(255, 153, 0, 0.4);
    animation: slideDown 0.3s ease;
}

.flow-demo-status .pulse-dot {
    width: 10px;
    height: 10px;
    background: white;
    border-radius: 50%;
    animation: pulse 1s infinite;
}

@keyframes slideDown {
    from { transform: translateX(-50%) translateY(-20px); opacity: 0; }
    to { transform: translateX(-50%) translateY(0); opacity: 1; }
}

/* Flow option buttons */
.flow-question {
    margin-top: 0.5rem;
}

.flow-question-text {
    margin-bottom: 0.75rem;
    line-height: 1.5;
}

.flow-options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.flow-option-btn {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    border: 1px solid #333;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
    width: 100%;
    pointer-events: auto !important;
    position: relative;
    z-index: 100;
}

.flow-option-btn:hover {
    border-color: #FF9900;
    background: linear-gradient(135deg, #232340, #1a2744);
    transform: translateX(4px);
}

.flow-option-btn:active {
    transform: scale(0.98);
}

.flow-options {
    pointer-events: auto !important;
}

.flow-question {
    pointer-events: auto !important;
}

.flow-option-label {
    font-weight: 600;
    color: #fff;
    font-size: 0.85rem;
    margin-bottom: 0.25rem;
}

.flow-option-desc {
    font-size: 0.7rem;
    color: #888;
}

.component-icon {
    font-size: 1.2rem;
}

.component-name {
    flex: 1;
}

.component-details {
    font-size: 0.65rem;
    color: #666;
    font-weight: 400;
}

/* Floating components when no tier info */
.floating-components {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    min-height: 300px;
}

/* Connection lines */
.connection-line {
    stroke: #999;
    stroke-width: 2;
    fill: none;
    marker-end: url(#arrowhead);
}

.connection-line.data-flow { stroke: #3B48CC; stroke-dasharray: 5,3; }
.connection-line.api-call { stroke: #FF9900; }
.connection-line.event { stroke: #FF4F8B; stroke-dasharray: 3,3; }

/* Canvas Toolbar */
.canvas-toolbar {
    position: absolute;
    top: 10px;
    left: 10px;
    display: flex;
    gap: 0.25rem;
    background: white;
    padding: 0.25rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
    z-index: 100;
}

.tool-btn {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 6px;
    background: transparent;
    cursor: pointer;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.tool-btn:hover {
    background: #f0f0f0;
}

.tool-btn.active {
    background: #FF9900;
    color: white;
}

.tool-btn[title]:hover::after {
    content: attr(title);
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    white-space: nowrap;
    margin-top: 4px;
}

/* Drawing canvas overlay */
.draw-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 50;
}

.draw-canvas.active {
    pointer-events: auto;
    cursor: crosshair;
}

/* Text annotation */
.annotation {
    position: absolute;
    background: #fffde7;
    border: 1px solid #ffd54f;
    border-radius: 4px;
    padding: 0.5rem;
    font-size: 0.8rem;
    min-width: 100px;
    cursor: move;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.annotation:focus {
    outline: 2px solid #FF9900;
}

/* Drawn boxes as DOM elements */
.drawn-box {
    position: absolute;
    border: 2px dashed #3B48CC;
    background: rgba(59, 72, 204, 0.05);
    border-radius: 8px;
    cursor: move;
    min-width: 50px;
    min-height: 50px;
}

.drawn-box:hover {
    border-color: #FF9900;
}

.drawn-box.selected {
    border-color: #FF9900;
    border-style: solid;
}

.drawn-box .resize-handle {
    position: absolute;
    width: 10px;
    height: 10px;
    background: #FF9900;
    border: 2px solid white;
    border-radius: 2px;
}

.drawn-box .resize-handle.nw { top: -5px; left: -5px; cursor: nw-resize; }
.drawn-box .resize-handle.ne { top: -5px; right: -5px; cursor: ne-resize; }
.drawn-box .resize-handle.sw { bottom: -5px; left: -5px; cursor: sw-resize; }
.drawn-box .resize-handle.se { bottom: -5px; right: -5px; cursor: se-resize; }

.drawn-box .box-label {
    position: absolute;
    top: -20px;
    left: 5px;
    font-size: 0.7rem;
    color: #3B48CC;
    background: white;
    padding: 0 4px;
    border-radius: 2px;
}

.drawn-box .box-label:empty { display: none; }

/* Live call indicator */
.live-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: #1a1a2e;
    border-radius: 8px;
    margin-bottom: 0.5rem;
}

.live-indicator.active {
    background: rgba(76, 175, 80, 0.2);
    border: 1px solid #4CAF50;
}

.live-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #666;
}

.live-indicator.active .live-dot {
    background: #4CAF50;
    animation: livePulse 1.5s infinite;
}

@keyframes livePulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.7); }
    50% { box-shadow: 0 0 0 8px rgba(76, 175, 80, 0); }
}

.live-btn {
    background: #4CAF50;
    border: none;
    border-radius: 6px;
    padding: 0.4rem 0.8rem;
    color: white;
    font-size: 0.8rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.live-btn:hover { background: #43a047; }
.live-btn.stop { background: #f44336; }
.live-btn.stop:hover { background: #e53935; }

/* ========== SERVICE LIBRARY SIDEBAR - Glassmorphism ========== */
.service-library {
    grid-row: 2;
    grid-column: 1;
    background: var(--secondary-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.library-toggle {
    padding: 0.875rem;
    background: rgba(35, 47, 62, 0.8);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s var(--transition-smooth);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.library-toggle:hover {
    background: linear-gradient(135deg, #FF9900 0%, #FF7B00 100%);
}

.library-toggle .toggle-icon {
    transition: transform 0.3s;
}

.service-library.expanded .toggle-icon {
    transform: rotate(180deg);
}

.library-search {
    padding: 0.5rem;
    display: none;
}

.service-library.expanded .library-search {
    display: block;
}

.library-search input {
    width: 100%;
    padding: 0.5rem;
    background: #0f0f1a;
    border: 1px solid #333;
    border-radius: 6px;
    color: white;
    font-size: 0.85rem;
}

.library-search input:focus {
    outline: none;
    border-color: #FF9900;
}

.library-categories {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
}

.library-category {
    margin-bottom: 0.5rem;
}

.category-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0.75rem;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.03) 100%);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.2s var(--transition-smooth);
}

.category-header:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.06) 100%);
    border-color: rgba(255, 255, 255, 0.1);
}

.category-header .cat-icon { font-size: 1rem; }
.category-header .cat-name {
    flex: 1;
    display: block !important;
    font-size: 0.7rem;
}

/* Always show category names */
.service-library:not(.expanded) .category-header .cat-name {
    display: block !important;
    font-size: 0.65rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.category-header .cat-count {
    background: #333;
    padding: 0.1rem 0.4rem;
    border-radius: 10px;
    font-size: 0.65rem;
    display: none;
}

.service-library.expanded .category-header .cat-count { display: block; }

.category-services {
    display: none;
    padding: 0.25rem 0 0.25rem 0.5rem;
}

.library-category.open .category-services { display: block; }

.service-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.6rem;
    margin: 0.25rem 0;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 8px;
    cursor: grab;
    font-size: 0.8rem;
    color: #ccc;
    transition: all 0.25s var(--transition-smooth);
    border-left: 3px solid transparent;
}

.service-item:hover {
    background: linear-gradient(90deg, rgba(255, 153, 0, 0.2) 0%, rgba(255, 153, 0, 0.05) 100%);
    border-left-color: #FF9900;
    box-shadow: 0 2px 8px rgba(255, 153, 0, 0.15);
    transform: translateX(4px);
}

.service-item.dragging {
    opacity: 0.5;
    cursor: grabbing;
}

.service-item .svc-icon { font-size: 1.2rem; }
.service-item .svc-name { flex: 1; display: none; }
.service-library.expanded .service-item .svc-name { display: block; }

.service-item .svc-provider {
    font-size: 0.6rem;
    padding: 0.1rem 0.3rem;
    border-radius: 3px;
    display: none;
}

.service-library.expanded .service-item .svc-provider { display: block; }

.svc-provider.aws { background: #FF9900; color: white; }
.svc-provider.azure { background: #0078D4; color: white; }
.svc-provider.gcp { background: #4285F4; color: white; }

/* Cloud provider filter tabs */
.provider-tabs {
    display: none;
    padding: 0.5rem;
    gap: 0.25rem;
}

.service-library.expanded .provider-tabs { display: flex; }

.provider-tab {
    flex: 1;
    padding: 0.4rem;
    border: none;
    border-radius: 4px;
    font-size: 0.7rem;
    cursor: pointer;
    background: #0f0f1a;
    color: #888;
}

.provider-tab.active { color: white; }
.provider-tab.active[data-provider="aws"] { background: #FF9900; }
.provider-tab.active[data-provider="azure"] { background: #0078D4; }
.provider-tab.active[data-provider="gcp"] { background: #4285F4; }
.provider-tab.active[data-provider="all"] { background: #666; }

/* Diagram panel in grid */
.diagram-panel {
    grid-row: 2;
    grid-column: 2;
}

/* Drop zone indicator */
.live-canvas.drop-active {
    background: rgba(255, 153, 0, 0.1);
    outline: 2px dashed #FF9900;
    outline-offset: -10px;
}

/* Quick add hint */
.quick-add-hint {
    position: absolute;
    bottom: 10px;
    left: 70px;
    background: rgba(0,0,0,0.8);
    color: #FF9900;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.75rem;
    display: none;
}

/* Session & Template Controls */
.session-controls {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.session-btn {
    padding: 0.4rem 0.8rem;
    background: rgba(255,255,255,0.1);
    border: 1px solid #444;
    border-radius: 6px;
    color: #ccc;
    font-size: 0.75rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    transition: all 0.2s;
}

.session-btn:hover {
    background: #FF9900;
    border-color: #FF9900;
    color: white;
}

/* Templates Modal - Glassmorphism */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 14, 39, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s var(--transition-smooth);
}

.modal-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: rgba(20, 30, 48, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6),
                0 8px 32px rgba(0, 0, 0, 0.4);
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    overflow: hidden;
    border: 1px solid #333;
    transform: scale(0.9);
    transition: transform 0.3s;
}

.modal-overlay.visible .modal {
    transform: scale(1);
}

.modal-header {
    padding: 1rem 1.5rem;
    background: #232F3E;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 1.1rem;
    color: #FF9900;
}

.modal-close {
    background: none;
    border: none;
    color: #888;
    font-size: 1.5rem;
    cursor: pointer;
}

.modal-close:hover { color: white; }

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    max-height: calc(80vh - 60px);
}

.templates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
}

.template-card {
    background: #0f0f1a;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 1rem;
    transition: all 0.2s;
}

.template-card:hover {
    border-color: #FF9900;
    transform: translateY(-2px);
}

.template-card .template-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.template-card h3 {
    font-size: 0.9rem;
    margin-bottom: 0.3rem;
    color: white;
}

.template-card p {
    font-size: 0.75rem;
    color: #888;
    line-height: 1.4;
}

.template-card .template-services {
    margin-top: 0.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.template-card .template-services span {
    font-size: 0.9rem;
}

.template-card .template-actions button {
    transition: transform 0.1s, filter 0.1s;
}

.template-card .template-actions button:hover {
    transform: translateY(-1px);
    filter: brightness(1.1);
}

.template-card .template-actions button:active {
    transform: translateY(0);
}

/* Sessions list */
.sessions-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.session-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: #0f0f1a;
    border: 1px solid #333;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.session-item:hover {
    border-color: #FF9900;
}

.session-item .session-info { flex: 1; }
.session-item .session-name { font-weight: 600; color: white; }
.session-item .session-date { font-size: 0.75rem; color: #888; }
.session-item .session-components { font-size: 0.8rem; color: #FF9900; }

.session-item .session-actions {
    display: flex;
    gap: 0.5rem;
}

.session-item .session-actions button {
    padding: 0.3rem 0.6rem;
    border: none;
    border-radius: 4px;
    font-size: 0.75rem;
    cursor: pointer;
}

.session-item .load-btn { background: #FF9900; color: white; }
.session-item .delete-btn { background: #f44336; color: white; }

.no-sessions {
    text-align: center;
    color: #666;
    padding: 2rem;
}

.session-item.active {
    border-color: #FF9900;
    background: rgba(255, 153, 0, 0.1);
}

/* Session Timeline */
.session-timeline {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.timeline-item {
    display: flex;
    gap: 0.75rem;
    padding: 0.75rem;
    background: #0f0f1a;
    border: 1px solid #333;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.timeline-item:hover {
    border-color: #FF9900;
    background: rgba(255, 153, 0, 0.05);
}

.timeline-item.user {
    border-left: 3px solid #4CAF50;
}

.timeline-item.system, .timeline-item.assistant {
    border-left: 3px solid #2196F3;
}

.timeline-index {
    background: #333;
    color: #fff;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: bold;
    flex-shrink: 0;
}

.timeline-content {
    flex: 1;
    min-width: 0;
}

.timeline-message {
    color: #eee;
    font-size: 0.85rem;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.timeline-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.7rem;
    color: #888;
}

.timeline-meta span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.timeline-restore {
    background: #FF9900;
    color: white;
    border: none;
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    font-size: 0.75rem;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s;
}

.timeline-item:hover .timeline-restore {
    opacity: 1;
}

/* Connection drawing */
.connection-point {
    position: absolute;
    width: 12px;
    height: 12px;
    background: #FF9900;
    border: 2px solid white;
    border-radius: 50%;
    cursor: crosshair;
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 60;
}

.arch-component:hover .connection-point {
    opacity: 1;
}

.connection-point.top { top: -6px; left: 50%; transform: translateX(-50%); }
.connection-point.bottom { bottom: -6px; left: 50%; transform: translateX(-50%); }
.connection-point.left { left: -6px; top: 50%; transform: translateY(-50%); }
.connection-point.right { right: -6px; top: 50%; transform: translateY(-50%); }

/* View mode tabs */
.view-tabs {
    display: flex;
    gap: 0.25rem;
    background: #eee;
    padding: 0.25rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.view-tab {
    padding: 0.5rem 1rem;
    background: transparent;
    border: none;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
    color: #666;
}

.view-tab.active {
    background: white;
    color: #232F3E;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.view-tab:hover:not(.active) {
    background: rgba(255,255,255,0.5);
}

/* Hide inactive views */
.diagram-view { display: none; height: 100%; }
.diagram-view.active { display: block; height: 100%; }

.diagram-container {
    height: 100%;
    display: flex;
    flex-direction: column;
}

#liveView, #mermaidView {
    flex: 1;
    min-height: 0;
}

/* Responsive Breakpoints - Mobile First */
@media (max-width: 900px) {
    .app-container {
        grid-template-columns: 1fr;
        grid-template-rows: 60px auto;
    }
    .service-library { display: none; }
    .diagram-panel { grid-column: 1; }
    .chat-panel { grid-column: 1; }
}

@media (max-width: 768px) {
    .app-container {
        grid-template-columns: 1fr;
        grid-template-rows: 50px 1fr;
    }
    .service-library { display: none; }
    .diagram-panel, .chat-panel {
        grid-column: 1;
        display: none;
    }
    .diagram-panel.active-tab, .chat-panel.active-tab {
        display: flex;
    }
    .mobile-tabs { display: flex !important; }
    header h1 { font-size: 0.9rem; }
    .session-controls { display: none; }
}

@media (min-width: 1024px) {
    .app-container {
        grid-template-columns: 120px 1fr 380px;
    }
}

@media (min-width: 1440px) {
    .app-container {
        grid-template-columns: 280px 1fr 420px;
    }
    .service-library { width: 280px; }
}

/* Mobile tab bar */
.mobile-tabs {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--secondary-bg, rgba(20, 30, 48, 0.95));
    backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 100;
    padding: 0.5rem;
    gap: 0.25rem;
    justify-content: space-around;
}

.mobile-tab {
    flex: 1;
    padding: 0.6rem;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: #94A3B8;
    font-size: 0.75rem;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
}

.mobile-tab.active {
    color: #FF9900;
    background: rgba(255, 153, 0, 0.15);
}

.mobile-tab i { display: block; font-size: 1.1rem; margin-bottom: 0.2rem; }

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    padding: 0.75rem 1.25rem;
    border-radius: 8px;
    color: white;
    font-size: 0.85rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    animation: toastSlideIn 0.3s ease-out;
    max-width: 350px;
}

.toast.success { background: #22c55e; }
.toast.error { background: #ef4444; }
.toast.info { background: #3b82f6; }
.toast.warning { background: #f59e0b; }

@keyframes toastSlideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Loading Skeletons */
.skeleton {
    background: linear-gradient(90deg, rgba(255,255,255,0.05) 25%, rgba(255,255,255,0.1) 50%, rgba(255,255,255,0.05) 75%);
    background-size: 200% 100%;
    animation: skeletonShimmer 1.5s infinite;
    border-radius: 4px;
    height: 1rem;
    margin: 0.5rem 0;
}

.skeleton.wide { width: 80%; }
.skeleton.medium { width: 60%; }
.skeleton.short { width: 40%; }

@keyframes skeletonShimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* Diagram zoom controls */
.zoom-controls {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    z-index: 50;
}

.zoom-btn {
    width: 36px;
    height: 36px;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 8px;
    background: rgba(20, 30, 48, 0.9);
    color: white;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.zoom-btn:hover {
    background: rgba(255, 153, 0, 0.3);
    border-color: #FF9900;
}

.zoom-level {
    text-align: center;
    font-size: 0.65rem;
    color: #94A3B8;
    padding: 0.2rem;
}

/* Keyboard shortcut help */
.shortcuts-modal {
    position: fixed;
    inset: 0;
    background: rgba(10, 14, 39, 0.85);
    backdrop-filter: blur(12px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.shortcuts-modal.visible {
    opacity: 1;
    visibility: visible;
}

.shortcuts-content {
    background: rgba(20, 30, 48, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 1.5rem;
    max-width: 500px;
    width: 90%;
}

.shortcuts-content h2 {
    color: #FF9900;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.shortcut-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.shortcut-row kbd {
    background: rgba(255,255,255,0.1);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.8rem;
    color: #FF9900;
}
