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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 16px;
}

.container {
    max-width: 600px;
    margin: 0 auto;
    background: white;
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo .emoji {
    font-size: 32px;
}

.logo h1 {
    font-size: 22px;
    font-weight: 700;
}

.status {
    background: rgba(255, 255, 255, 0.2);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
}

.main-content {
    padding: 20px;
}

.problem-card {
    background: #f8f9fa;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
    border-left: 4px solid #667eea;
}

.problem-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.difficulty-badge {
    background: #667eea;
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.problem-header h2 {
    font-size: 18px;
    font-weight: 700;
    color: #1a1a1a;
}

.problem-content p {
    font-size: 16px;
    color: #4a4a4a;
    margin-bottom: 12px;
}

.formula {
    background: white;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    font-size: 20px;
    font-weight: 600;
    color: #667eea;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.chat-area {
    height: 300px;
    overflow-y: auto;
    background: #f8f9fa;
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 20px;
}

.message {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    animation: slideIn 0.3s ease;
}

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

.message-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.message-content {
    background: white;
    padding: 12px 16px;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    max-width: 80%;
}

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

.user-message .message-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.control-panel {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.btn {
    padding: 14px 28px;
    border: none;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

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

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-danger {
    background: #e74c3c;
    color: white;
}

.btn-warning {
    background: #f39c12;
    color: white;
}

.btn-icon {
    font-size: 20px;
}

.debug-info {
    margin-top: 20px;
    font-size: 12px;
}

.debug-info details {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 12px;
}

.debug-info summary {
    cursor: pointer;
    color: #667eea;
    font-weight: 600;
}

#debugContent {
    margin-top: 12px;
    color: #666;
    font-family: monospace;
    white-space: pre-wrap;
}

@media (max-width: 480px) {
    body {
        padding: 0;
    }

    .container {
        border-radius: 0;
        min-height: 100vh;
    }

    .logo h1 {
        font-size: 18px;
    }

    .status {
        font-size: 12px;
        padding: 6px 12px;
    }

    .btn {
        padding: 12px 20px;
        font-size: 14px;
    }
}