* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    height: 100vh;
    padding: 20px;
}

.main-container {
    display: flex;
    gap: 20px;
    max-width: 1900px;
    margin: 0 auto;
    height: 100%;
    align-items: stretch;
    justify-content: center;
}

.chat-container {
    flex: 0 0 800px;
    height: 90vh;
    max-height: 1100px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.right-side-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 1100px;
    height: 90vh;
    max-height: 1100px;
}

.widget-container {
    flex: 0 0 300px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.chart-container {
    flex: 1;
    min-height: 0;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.chart-wrapper {
    flex: 1;
    display: flex;
    position: relative;
    min-height: 0;
}

.chart-wrapper iframe {
    flex: 1;
    min-height: 0;
    border: none;
}

.widget-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    min-height: 0;
}

.widget-wrapper iframe {
    flex: 1;
    min-height: 0;
}

.poweredBy {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 11px;
    color: #666;
    padding: 8px 12px;
    text-align: center;
    background: #f8f9fa;
    border-top: 1px solid #e5e7eb;
}

.poweredBy a {
    color: #667eea;
    text-decoration: none;
}

.poweredBy a:hover {
    text-decoration: underline;
}

.chat-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.header-content {
    display: flex;
    align-items: center;
    gap: 15px;
}

.bot-avatar {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    backdrop-filter: blur(10px);
}

.header-text h1 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 4px;
}

.status {
    font-size: 13px;
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 6px;
}

.status::before {
    content: '';
    width: 8px;
    height: 8px;
    background: #4ade80;
    border-radius: 50%;
    display: inline-block;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: #f8f9fa;
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #aaa;
}

.message {
    display: flex;
    gap: 12px;
    animation: fadeIn 0.3s ease-in;
    max-width: 80%;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.user-message {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.bot-message {
    align-self: flex-start;
}

.message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.bot-message .message-avatar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.user-message .message-avatar {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.message-content {
    background: white;
    padding: 12px 16px;
    border-radius: 18px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.user-message .message-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.message-content p {
    margin: 0;
    line-height: 1.5;
    word-wrap: break-word;
}

.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 8px 0;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: #999;
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
    }
    30% {
        transform: translateY(-10px);
    }
}

.chat-input-container {
    padding: 20px 24px;
    background: white;
    border-top: 1px solid #e5e7eb;
}

.input-wrapper {
    display: flex;
    gap: 12px;
    align-items: center;
}

#userInput {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 24px;
    font-size: 15px;
    outline: none;
    transition: all 0.3s ease;
}

#userInput:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.send-button {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.send-button:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.send-button:active {
    transform: scale(0.95);
}

.send-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* 반응형 디자인 */
@media (max-width: 1600px) {
    .main-container {
        max-width: 100%;
        padding: 0 10px;
    }
    
    .chat-container {
        flex: 0 0 600px;
    }
    
    .right-side-container {
        max-width: 900px;
    }
}

@media (max-width: 1024px) {
    .main-container {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    .chat-container {
        flex: 0 0 auto;
        width: 100%;
        max-width: 100%;
        height: 50vh;
        max-height: 50vh;
    }
    
    .right-side-container {
        width: 100%;
        max-width: 100%;
        height: 50vh;
        max-height: 50vh;
    }
    
    .widget-container {
        flex: 0 0 200px;
    }
    
    .chart-container {
        flex: 1;
    }
}

@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .main-container {
        flex-direction: column;
        gap: 10px;
        height: 100vh;
    }
    
    .chat-container {
        flex: 0 0 auto;
        height: 40vh;
        max-height: 40vh;
        border-radius: 15px;
    }
    
    .right-side-container {
        flex: 1;
        height: 60vh;
        max-height: 60vh;
    }
    
    .widget-container {
        flex: 0 0 150px;
    }
    
    .chart-container {
        flex: 1;
    }
    
    .message {
        max-width: 85%;
    }
    
    .chat-header {
        padding: 16px 20px;
    }
    
    .header-text h1 {
        font-size: 18px;
    }
}

